R
RyanH
My Select Case is not returning the correct string. For example, when L =
39, my code always returns "18'' T12 (F18T12HO)" and not "36'' T12
(F36T12HO)", why?
I think VBA is just looking at the first part of Case and not the part after
the AND. I'm not sure how to force it to look at the part after the AND.
Sub cmbEstimate_Click()
Select Case L = Lwidth - Sockets
Case L < 18
MsgBox "This cabinet is too small to use Fluorescents.", vbCritical
Exit Sub
Case 18 < L And L <= 24
cboLamps1 = "18'' T12 (F18T12HO)"
Case 24 < L And L <= 30
cboLamps1 = "24'' T12 (F24T12HO)"
Case 30 < L And L <= 36
cboLamps1 = "30'' T12 (F30T12HO)"
Case 36 < L And L <= 42
cboLamps1 = "36'' T12 (F36T12HO)"
End select
End sub
Thanks in Advance,
Ryan
39, my code always returns "18'' T12 (F18T12HO)" and not "36'' T12
(F36T12HO)", why?
I think VBA is just looking at the first part of Case and not the part after
the AND. I'm not sure how to force it to look at the part after the AND.
Sub cmbEstimate_Click()
Select Case L = Lwidth - Sockets
Case L < 18
MsgBox "This cabinet is too small to use Fluorescents.", vbCritical
Exit Sub
Case 18 < L And L <= 24
cboLamps1 = "18'' T12 (F18T12HO)"
Case 24 < L And L <= 30
cboLamps1 = "24'' T12 (F24T12HO)"
Case 30 < L And L <= 36
cboLamps1 = "30'' T12 (F30T12HO)"
Case 36 < L And L <= 42
cboLamps1 = "36'' T12 (F36T12HO)"
End select
End sub
Thanks in Advance,
Ryan