VBA script question

H

Howard

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
 
F

FSt1

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
 
H

Howard

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top