Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Need some macro codes

I have two separate macro programs:
1. Run_Daily() - which is run each day, Monday to Friday.
2. Run_Weekly() - which is run only on Friday.
How can I combine them into a single program so that they still run
correctly?
Thank you for any help.

zen65


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,290
Default Need some macro codes


Something like this?...
'--
Sub DailyProgram()
'Existing code followed by...
If WeekDay(Date, vbSunday) = vbFriday Then
Call WeeklyProgram
End If
End Sub
'--
Sub WeeklyProgram()
'Existing code here
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"zen65"
wrote in message
I have two separate macro programs:
1. Run_Daily() - which is run each day, Monday to Friday.
2. Run_Weekly() - which is run only on Friday.
How can I combine them into a single program so that they still run
correctly?
Thank you for any help.
zen65


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Need some macro codes

So, now I have to run only the "DailyProgram" and it automatically takes
care of the "WeeklyProgram". That sounds great! Much appreciate your help.
Thank you Jim.

zen65

"Jim Cone" wrote in message
...

Something like this?...
'--
Sub DailyProgram()
'Existing code followed by...
If WeekDay(Date, vbSunday) = vbFriday Then
Call WeeklyProgram
End If
End Sub
'--
Sub WeeklyProgram()
'Existing code here
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"zen65"
wrote in message
I have two separate macro programs:
1. Run_Daily() - which is run each day, Monday to Friday.
2. Run_Weekly() - which is run only on Friday.
How can I combine them into a single program so that they still run
correctly?
Thank you for any help.
zen65




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,290
Default Need some macro codes


zen65,
You are welcome.
The code assumes that your calendar week starts on Sunday.
(that is what the "vbSunday" tells Excel)
Also, both macros should be in the same module or the weekly
macro in a general/regular module.
You might want to set your computer clock to a Friday
and test it before relying on it.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel add-ins; some free and some for sale)


"zen65" wrote in
message
So, now I have to run only the "DailyProgram" and it automatically takes
care of the "WeeklyProgram". That sounds great! Much appreciate your help.
Thank you Jim.
zen65

"Jim Cone"
wrote in message
Something like this?...
'--
Sub DailyProgram()
'Existing code followed by...
If WeekDay(Date, vbSunday) = vbFriday Then
Call WeeklyProgram
End If
End Sub
'--
Sub WeeklyProgram()
'Existing code here
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"zen65"
wrote in message
I have two separate macro programs:
1. Run_Daily() - which is run each day, Monday to Friday.
2. Run_Weekly() - which is run only on Friday.
How can I combine them into a single program so that they still run
correctly?
Thank you for any help.
zen65




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Need some macro codes

I'm trying to do the same thing as Zen65, but don't have any date requirements.
I just want my other macros within the same workbook to execute when I run
this
macro. What would the code look like?

Thanks,
James



"Jim Cone" wrote:


zen65,
You are welcome.
The code assumes that your calendar week starts on Sunday.
(that is what the "vbSunday" tells Excel)
Also, both macros should be in the same module or the weekly
macro in a general/regular module.
You might want to set your computer clock to a Friday
and test it before relying on it.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel add-ins; some free and some for sale)


"zen65" wrote in
message
So, now I have to run only the "DailyProgram" and it automatically takes
care of the "WeeklyProgram". That sounds great! Much appreciate your help.
Thank you Jim.
zen65

"Jim Cone"
wrote in message
Something like this?...
'--
Sub DailyProgram()
'Existing code followed by...
If WeekDay(Date, vbSunday) = vbFriday Then
Call WeeklyProgram
End If
End Sub
'--
Sub WeeklyProgram()
'Existing code here
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"zen65"
wrote in message
I have two separate macro programs:
1. Run_Daily() - which is run each day, Monday to Friday.
2. Run_Weekly() - which is run only on Friday.
How can I combine them into a single program so that they still run
correctly?
Thank you for any help.
zen65





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
codes, codes, codes... jatman Excel Discussion (Misc queries) 2 August 20th 06 07:30 AM
hiding macro codes upon protecting the worksheet eehj23 Excel Discussion (Misc queries) 1 April 28th 06 03:55 AM
Bar Codes [email protected] Excel Discussion (Misc queries) 4 August 31st 05 08:12 AM
Am I asking to much from vb codes? Mr. G. Excel Worksheet Functions 0 July 14th 05 10:36 PM
VBA Codes smck Excel Worksheet Functions 2 May 11th 05 10:03 AM


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