Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i use the following and it works fine in my code:
Case Is = "Requests" vtype = "R" Case Is = "Approvals" vtype = "A" now i want another case to include both R and A tried: Case Is = "All" vtype = "R" or "A" didn't work, evaluates to acting on every cell value.. can some help me so i can check whether the value in a cell is either an R or an A and execute the code. -- Gary |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Gary,
can some help me so i can check whether the value in a cell is either an R or an A and execute the code. Try something like: For Each rCell In rng.Cells Select Case rCell.Value Case "R", "A": MsgBox "Hi" Case Else: MsgBox "No!" End Select Next rCell --- Regards, Norman "Gary Keramidas" <GKeramidasATmsn.com wrote in message ... i use the following and it works fine in my code: Case Is = "Requests" vtype = "R" Case Is = "Approvals" vtype = "A" now i want another case to include both R and A tried: Case Is = "All" vtype = "R" or "A" didn't work, evaluates to acting on every cell value.. can some help me so i can check whether the value in a cell is either an R or an A and execute the code. -- Gary |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi norman
thanks, but i don't really want to rewrite all of the code, so i'd like it to follow what i already have. Case Is = "Requests" vtype = "R" Case Is = "Approvals" vtype = "A" case is "All" vtype = "R","A" ' or something like this can't use case is r or case is a without a lot of rewriting -- Gary "Norman Jones" wrote in message ... Hi Gary, can some help me so i can check whether the value in a cell is either an R or an A and execute the code. Try something like: For Each rCell In rng.Cells Select Case rCell.Value Case "R", "A": MsgBox "Hi" Case Else: MsgBox "No!" End Select Next rCell --- Regards, Norman "Gary Keramidas" <GKeramidasATmsn.com wrote in message ... i use the following and it works fine in my code: Case Is = "Requests" vtype = "R" Case Is = "Approvals" vtype = "A" now i want another case to include both R and A tried: Case Is = "All" vtype = "R" or "A" didn't work, evaluates to acting on every cell value.. can some help me so i can check whether the value in a cell is either an R or an A and execute the code. -- Gary |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Case without Select Case error problem | Excel Discussion (Misc queries) | |||
Case Select | Excel Programming | |||
Select Case help | Excel Programming | |||
For Each with Select Case | Excel Programming |