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: 186
Default More Efficient If Statement

I have the following code as part of a macro. Is there a more efficient (i.e.
less code) way of writing this IF statement?

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Address = "$G$9" Or Target.Address = "$G$10" Or _
Target.Address = "$G$11" Or Target.Address = "$G$12" Or _
Target.Address = "$G$13" Or Target.Address = "$G$17" Or _
Target.Address = "$G$18" Or Target.Address = "$G$19" Or _
Target.Address = "$G$20" Or Target.Address = "$G$21" Or _
Target.Address = "$G$25" Or Target.Address = "$G$26" Or _
Target.Address = "$G$27" Or Target.Address = "$G$28" Or _
Target.Address = "$G$29" Then
........................

TIA.
--
Ken Hudson
 
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
More Efficient IF David Excel Programming 7 September 28th 07 01:51 PM
More Efficient IF David Excel Programming 1 September 28th 07 12:23 PM
Is there a more efficient way to do this? Steve Roberts Excel Programming 1 September 26th 05 05:34 PM
More efficient way? Steph[_3_] Excel Programming 6 June 23rd 04 09:34 PM
Q: Is this vlookup statement efficient? John[_60_] Excel Programming 1 October 8th 03 09:37 AM


All times are GMT +1. The time now is 04:17 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"