I am trying to use a text string in a select case statement in VBA. To
wit:
Select Case test_string
Case Is = "first header"
statement 1
Case Is = "second header"
statement 2
etc
End Select
I've been trying (without luck) to get VBA to recognize the text
string.
Any suggestions?
Art
c1802362 or Art -
What is the text string test_string? Where is it defined and how?
For example, in a standard module, this works:
Sub test()
test_string = "first header"
Select Case test_string
Case Is = "first header"
MsgBox "First Header"
Case Is = "second header"
MsgBox "Second Header"
End Select
End Sub
- Mike Middleton
http://www.DecisionToolworks.com
Decision Analysis Add-ins for Excel
>I am trying to use a text string in a select case statement in VBA. To
> wit:
[quoted text clipped - 17 lines]
>
> Art