Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default setting a condition to call a macro

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
--
Darren
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default setting a condition to call a macro

damn big fingers

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

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

--
Don Guillett
SalesAid Software

"Darren" wrote in message
...
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
--
Darren



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default setting a condition to call a macro

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

--
Regards,
Tom Ogilvy

"Darren" wrote in message
...
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
--
Darren



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default setting a condition to call a macro

The suggestions work fine

thanks for the help
--
Darren


"Darren" wrote:

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
--
Darren



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
setting more than one condition and multiple ranges Sapper Excel Discussion (Misc queries) 1 April 23rd 09 11:32 AM
Excel Macro call Word Macro with Parameters Bill Sturdevant[_2_] Excel Programming 9 May 24th 07 12:21 AM
Call macro stored in Excel workbook from Outlook's macro Gvaram Excel Programming 0 October 4th 06 05:47 PM
Setting Application.EnableEvents=True after Thisworkbook.Close call John Fuller Excel Programming 3 September 4th 06 02:50 PM
Sending email via macro- setting the importance setting. Julian Milano[_2_] Excel Programming 1 January 20th 04 10:15 PM


All times are GMT +1. The time now is 02:50 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"