View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
John Wilson John Wilson is offline
external usenet poster
 
Posts: 550
Default Structure of If...Else in VBA

Sheela,

If the following example doesn't help, please post an example of your
code:

This works for me:

If cMan1 = cMan2 And cMan1 = cMan3 And cMod1 = cMod2 And cMod1 = cMod3
Then
' do something
Else
' do something
End If

Sheela wrote:

Hello,

I have a situation here. When I break up an if..else
statement in the excel worksheet, as in A < B < C to AND
(A<B;B<C), it works but when I convert to VBA as in "If
(A<B) And (B<C) Then" it does not work. I realized it
makes a difference when I break up the condition in
worksheet but how do I go about doing it in VBA?

Thanks for your help.

Sheela