#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Help!

I am running into a problem with the following line in my program. Can
someone tell me the correct syntax?:

ElseIf Range("AG16").Value = "N" And Range("V38,V45,V52,V58,V65,V72,V78,V84").
Value < "Amy" Or "Alternate" Then
ActiveCell = "Amy"


--
Message posted via http://www.officekb.com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Help!

Hi Erik,

Try something like:


Set rng = Range("V38,V45,V52,V58,V65,V72,V78,V84")

If SomeCondition Then
'Do something
ElseIf Range("AG16").Value = "N" _
And rng.Value < "Amy" _
Or rng.Value < "Alternate" Then
ActiveCell = "Amy"
End If


---
Regards,
Norman



"Erik K via OfficeKB.com" <u13156@uwe wrote in message
news:56289c42fefa9@uwe...
I am running into a problem with the following line in my program. Can
someone tell me the correct syntax?:

ElseIf Range("AG16").Value = "N" And
Range("V38,V45,V52,V58,V65,V72,V78,V84").
Value < "Amy" Or "Alternate" Then
ActiveCell = "Amy"


--
Message posted via http://www.officekb.com



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Help!

Probably better written as

Set rng = Range("V38,V45,V52,V58,V65,V72,V78,V84")

If SomeCondition Then
'Do something
ElseIf Range("AG16").Value = "N" And _
(rng.Value < "Amy" Or _
rng.Value < "Alternate") Then
ActiveCell = "Amy"
End If



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Norman Jones" wrote in message
...
Hi Erik,

Try something like:


Set rng = Range("V38,V45,V52,V58,V65,V72,V78,V84")

If SomeCondition Then
'Do something
ElseIf Range("AG16").Value = "N" _
And rng.Value < "Amy" _
Or rng.Value < "Alternate" Then
ActiveCell = "Amy"
End If


---
Regards,
Norman



"Erik K via OfficeKB.com" <u13156@uwe wrote in message
news:56289c42fefa9@uwe...
I am running into a problem with the following line in my program. Can
someone tell me the correct syntax?:

ElseIf Range("AG16").Value = "N" And
Range("V38,V45,V52,V58,V65,V72,V78,V84").
Value < "Amy" Or "Alternate" Then
ActiveCell = "Amy"


--
Message posted via http://www.officekb.com





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



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