LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 215
Default Better way for writing IF statement ?

Hello;

Is there a better (more intelligent) way of writing the following sample
single-line IF statement in Excel VBA procedure (macro):

IF myVar1 = 1 And myVar1 < 100 And myVar1 < 25 And myVar1 <= Index Then
GoTo myLable

rather than repeating the same variable name over and over and over again ??

Does With structure allow comparison operators ??

Thank you kindly.
 
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
NEED HELP WRITING IF STATEMENT bumblebug Excel Discussion (Misc queries) 5 October 7th 08 01:34 PM
Writing IF Statement Angie Excel Worksheet Functions 4 June 5th 07 10:10 PM
writing a statement newexceluser Excel Worksheet Functions 1 July 21st 06 10:15 PM
Help writing an IF statement cynichromantique Excel Worksheet Functions 6 April 1st 06 12:51 AM
need help in writing a statement susan hayes Excel Programming 3 September 28th 04 04:37 AM


All times are GMT +1. The time now is 11:06 PM.

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

About Us

"It's about Microsoft Excel"