ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help! (https://www.excelbanter.com/excel-programming/343434-help.html)

Erik K via OfficeKB.com[_2_]

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

Norman Jones

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




Bob Phillips[_6_]

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







All times are GMT +1. The time now is 05:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com