jarvisaurus
Board Regular
- Joined
- Nov 26, 2010
- Messages
- 52
Is it possible to have multiple select case conditions?
e.g.
Select Case Range("A2").Value & Range("B2").Value
Case 1/1/10 to 3/31/10, 1 to 100
Range("C2").Formula = Range("B2").Value*1000
I have to check multiple columns and the following code doesn't seem to work.
I want to check values in Columns GU for Blue, Columns K for the date, and Columns W for a value. If all three cells meet the condition the formula as follows. Thanks in advance.
e.g.
Select Case Range("A2").Value & Range("B2").Value
Case 1/1/10 to 3/31/10, 1 to 100
Range("C2").Formula = Range("B2").Value*1000
I have to check multiple columns and the following code doesn't seem to work.
PHP:
Sub TEST_SelectCase()
Dim i As Integer
Dim LR As Long
Dim therange As Range
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = LR To 2 Step -1
Select Case Cells(i, "GU").Value & Cells(i, "K").Value & Cells(i, "W").Value
Case "BLUE", 4 / 1 / 2010 To 4 / 30 / 2010, 1 To 100
Cells(i, "AI").Formula = Cells(i, "X") * 5015
End Select
Next i
End Sub
I want to check values in Columns GU for Blue, Columns K for the date, and Columns W for a value. If all three cells meet the condition the formula as follows. Thanks in advance.