View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Beertje Beertje is offline
external usenet poster
 
Posts: 10
Default Passing a string to Case statement

My current code reads:


Select Case Cells(i, 8)
Case "ABC", "DEF", "GHI"
......
End select

Since I have different of these cases I wonder if it is possible to use a
variable as follows:


Dim CaseVariable as variant
Set CaseVariable= "ABC"
Select Case Cells(i, 8)
Case CaseVariable
......
End select

So far I cannot get this working. Is it possible? Please advise.