Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Applications / Excel / May 2008



Tip: Looking for answers? Try searching our database.

select case arguments

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
c1802362 - 06 May 2008 01:33 GMT
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
Mike Middleton - 06 May 2008 07:36 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.