Hey guys,
New job.. Lots of excels to work on and I want to use macros to simplify my life.. I'm a Php & Java programmer and VBA gets me frustrated for being too basic.
I want to use a double conditional. A Select Case within an if statement. however it seems VBA doesn't see the scope of what I am trying to do and simply ends the if before starting the Select Case.
here is a general overview
If Cells(x, 1).Value = "" Then total = total + Cells(x, 9).Value Else _
Select Case step
Case 1
Cells(9, 13).Value = total
Case 2
Cells(12, 13).Value = total
Case 3
Cells(15, 13).Value = total
Case 4
Cells(18, 13).Value = total
Case Else
Cells(21, 13).Value = total
End Select
total = 0
step = step + 1
End If
In PHP or JAVA the {} would compensate for this issue but since VB doesn't allow them... I have tried to look online and other than making a 20 condition long if, I have found no solutions to what should be a simple poblem.
I'm sure this is simple so if there is an other thread, feel free to throw me straight to it.
Thanks everyone
Bookmarks