Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Peter
You could do it with a Select Case structu Select Case Cells(40, 1).Value Case "Jack", "Paddy", "Andy", "Gary" Cells(41, 1) = "Jazz" Case Else Cells(41, 1) = "Blues" End Select If you wanted to use If you'd need to do it like: If Cells(40,1) = "Jack" Or Cells(40,1) = "Paddy" Or ... etc which is long-winded. You don't want to use Xor. Richard Peter wrote: Can any one help?! I am trying to say: If cell [blah,blah] = Jack or Paddy then cell [blah, blah] should = Jazz The code I've got is: If Cells(40, 1).Value = "Jack" Xor "Paddy" Xor "Andy" Xor "Gary" Then Cells(41, 1).Value = "Jazz" Else Cells(41, 1).Value = "Blues" End If Needless to say that it doesn't work, so if any of you experts in google land have any ideas then I'd be very grateful to hear them. Thanks, Peter |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Where are Bitwise Operators | Excel Worksheet Functions | |||
Comparison Operators | Excel Programming | |||
greater than but less than operators for VBA | Excel Programming | |||
Operators With Times | Excel Discussion (Misc queries) | |||
Unary operators | Excel Worksheet Functions |