Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default VBA script question

I need a short VBA script that will check a specific cell on a worksheet for
the day of the week (from a drop-down menu) and then run the required macro
(one for each day of the week). Any ideas
Thanks
--
Howard
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default VBA script question

hi
this should get you going. i didn't put all the days in the macro but you
can add what days you require. also you may need to adjust the taget cell.

Sub selectthecase()
Dim r As Range
Set r = Range("A1")
If IsEmpty(r) Then 'in case cell is empty
MsgBox "need imput"
Exit Sub
End If

Select Case r
Case Is = "Monday"
Call mondaymacro
Case Is = "Tuesday"
Call Tuesdaymacro
Case Is = "wednesday"
Call Wednesdaymacro
Case Else
MsgBox "on your own here?"
End Select

End Sub

regards
FSt1

"Howard" wrote:

I need a short VBA script that will check a specific cell on a worksheet for
the day of the week (from a drop-down menu) and then run the required macro
(one for each day of the week). Any ideas
Thanks
--
Howard

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default VBA script question

FSt1
Thanks for the quick reply. This should do nicely. I'll give it a try.

Howard
--
Howard


"FSt1" wrote:

hi
this should get you going. i didn't put all the days in the macro but you
can add what days you require. also you may need to adjust the taget cell.

Sub selectthecase()
Dim r As Range
Set r = Range("A1")
If IsEmpty(r) Then 'in case cell is empty
MsgBox "need imput"
Exit Sub
End If

Select Case r
Case Is = "Monday"
Call mondaymacro
Case Is = "Tuesday"
Call Tuesdaymacro
Case Is = "wednesday"
Call Wednesdaymacro
Case Else
MsgBox "on your own here?"
End Select

End Sub

regards
FSt1

"Howard" wrote:

I need a short VBA script that will check a specific cell on a worksheet for
the day of the week (from a drop-down menu) and then run the required macro
(one for each day of the week). Any ideas
Thanks
--
Howard

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default VBA script question

I tried this and it isn't working. If I manually run the sub, it works, but
I need it to run any time that the text in the "r" cell is changed. Any
ideas?
Thanks for all the help
--
Howard


"FSt1" wrote:

hi
this should get you going. i didn't put all the days in the macro but you
can add what days you require. also you may need to adjust the taget cell.

Sub selectthecase()
Dim r As Range
Set r = Range("A1")
If IsEmpty(r) Then 'in case cell is empty
MsgBox "need imput"
Exit Sub
End If

Select Case r
Case Is = "Monday"
Call mondaymacro
Case Is = "Tuesday"
Call Tuesdaymacro
Case Is = "wednesday"
Call Wednesdaymacro
Case Else
MsgBox "on your own here?"
End Select

End Sub

regards
FSt1

"Howard" wrote:

I need a short VBA script that will check a specific cell on a worksheet for
the day of the week (from a drop-down menu) and then run the required macro
(one for each day of the week). Any ideas
Thanks
--
Howard

Reply
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
Autofill script question Gor_yee Excel Discussion (Misc queries) 2 August 4th 07 07:29 PM
VB Script for Excel Revised Question VB Script for Excel Excel Programming 3 March 23rd 06 03:33 AM
VB Script for Excel Revised Question VB Script for Excel Excel Programming 1 March 22nd 06 12:20 PM
Script question Chris Excel Programming 0 July 12th 05 11:20 AM
excel script question -- numbers to words bronach Excel Programming 4 August 11th 04 08:12 PM


All times are GMT +1. The time now is 01:31 PM.

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"