coding help(OR statement)

A

ah

Hi, appreciate if someone could help me with the following:

I've created a form with the folowing user form coding:


Dim myArray4() As String 'CCM
Dim myArray6() As String 'FRANCE
Dim myArray7() As String 'GERMANY
Dim myArray19() As String 'UNITED KINGDOM



Dim i As Long


myArray6 = Split("AN(Angers) CR(Crolles) FR(France) PR(Paris) TL(Toulouse)")


Me.PayScaleArea.Clear
Select Case ActiveDocument.FormFields("Country_Name").Result

Case "Switzerland"
Me.PayScaleArea.List = myArray4


Case "FRANCE"
Me.PayScaleArea.List = myArray6
Case "GERMANY"
Me.PayScaleArea.List = myArray7

Case "UK/IRELAND"
Me.PayScaleArea.List = myArray19


End Select
End Sub
 
G

Greg Maxey

I am not sure if I understand your question.

You want the same thing in the list if the user selects GERMANY, DENMARK or
SWITZERLAND?

Private Sub UserForm_Initialize()

Dim myArray4() As String 'CCM
Dim myArray6() As String 'FRANCE
Dim myArray7() As String 'GERMANY
Dim myArray19() As String 'UNITED KINGDOM
Dim pStr As String
Dim i As Long


myArray6 = Split("AN(Angers) CR(Crolles) FR(France) PR(Paris) TL(Toulouse)")
myArray7 = Split("A B C D E F G")
pStr = "DENMARK"
Me.PayScaleArea.Clear
Select Case pStr 'ActiveDocument.FormFields("Country_Name").Result
Case "FRANCE"
Me.PayScaleArea.List = myArray6
Case "GERMANY", "SWITZERLAND", "DENMARK"
Me.PayScaleArea.List = myArray7
Case "UK/IRELAND"
Me.PayScaleArea.List = myArray19
End Select
End Sub


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org~~~~~~~~~~~~~~~~~~~~~~~~~~
 
J

Jay Freedman

Hi, appreciate if someone could help me with the following:

I've created a form with the folowing user form coding:


Dim myArray4() As String 'CCM
Dim myArray6() As String 'FRANCE
Dim myArray7() As String 'GERMANY
Dim myArray19() As String 'UNITED KINGDOM



Dim i As Long


myArray6 = Split("AN(Angers) CR(Crolles) FR(France) PR(Paris) TL(Toulouse)")


Me.PayScaleArea.Clear
Select Case ActiveDocument.FormFields("Country_Name").Result

Case "Switzerland"
Me.PayScaleArea.List = myArray4


Case "FRANCE"
Me.PayScaleArea.List = myArray6
Case "GERMANY"
Me.PayScaleArea.List = myArray7

Case "UK/IRELAND"
Me.PayScaleArea.List = myArray19


End Select
End Sub

-------------

I wish to get the same selection list with Germany (myArray7) when I select
another 2 country called "Switzerland" or "Denmark".
Can anyone guide me on how to put a OR statement in the above coding?

Just add the expressions to the same Case line, separated by commas:

Case "GERMANY", "SWITZERLAND", "DENMARK"

Then any of those three values will cause the myArray7 value to be assigned.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

User Form question 1

Top