Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default need some select case guidance

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default need some select case guidance

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default need some select case guidance

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
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
Case without Select Case error problem Ayo Excel Discussion (Misc queries) 2 May 16th 08 03:48 PM
Case Select Jimbola Excel Programming 11 December 11th 05 06:45 PM
Select Case help Ramthebuffs[_14_] Excel Programming 4 October 13th 05 12:41 AM
For Each with Select Case helmekki[_31_] Excel Programming 0 October 15th 04 03:49 AM


All times are GMT +1. The time now is 10:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"