setting a condition to call a macro

G

Guest

In cell A1 I have a date in the format of DD/MM/YYYY. I want to be able to
extract the month and from that run a macro based on that months value

eg If january run macro january
if febuary run macro febuary
and so on until december

any suggestions on how I do this.

Thanks
 
D

Don Guillett

damn big fingers

In simplest form, if you had a series of macros named MyNum1, MyNum2, -12
then

Application.Run ("MyNum" & Month(Range("a2")))
 
T

Tom Ogilvy

Dim s as String
s = Format(Activesheet.Range("A1").Value,"mmmm")
Application.Run "'" & Thisworkbook.name & "'!" & s
 

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