LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default Using "case" code in Excel

I have the following problem. Cell J2 contains a drop-down menu of week
days. I am trying to use VBA to check the text in cell J2, and then run a
macro that matches the week day. The code follows, but it doesn't seem to
work. Any suggestions?

Sub selectthecase()

Dim r As Range
Set r = Range("J2")

Select Case r
Case Is = "MONDAY"
Call MondayMacro
Case Is = "TUESDAY"
Call TuesdayMacro
Case Is = "WEDNESDAY"
Call WednesdayMacro
Case Is = "THURSDAY"
Call ThursdayMacro
Case Is = "FRIDAY"
Call FridayMacro
Case Is = "SATURDAY"
Call SaturdayMacro
End Select

End Sub
--
Howard
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
lower case letter "i" always converts to upper case Carolyn Excel Discussion (Misc queries) 1 August 28th 08 01:56 AM
Converting "uppercase" string data to "lower case" in CSV file [email protected] Excel Discussion (Misc queries) 2 August 12th 08 08:36 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
how do I count only lower case "x" and exclude upper case "X" jbeletz Excel Worksheet Functions 3 October 14th 06 10:50 PM
Fix Code: Select Case and "Contains" selection Bettergains Excel Programming 5 April 26th 05 02:22 AM


All times are GMT +1. The time now is 08:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"