Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Structure of If...Else in VBA

I must attach the excel VBA for the coding is long. I can
tell you the problem I'm facing by referring to the excel
userform. Can I send to your email address instead of
using the newsgroup forum?

Thanks,

sheela
-----Original Message-----
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


.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula structure Excel Erick Excel Worksheet Functions 3 December 25th 08 10:16 AM
Do I need to use VBA for the following control structure? cfman Excel Discussion (Misc queries) 2 March 1st 07 11:42 AM
Help with formula structure Richard Excel Discussion (Misc queries) 4 October 7th 06 02:35 AM
Please help me... with Case Structure LSB M Excel Worksheet Functions 3 July 12th 06 09:31 AM
Wacky Little IF Structure nevi Excel Discussion (Misc queries) 3 June 24th 06 01:19 AM


All times are GMT +1. The time now is 05:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"