Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a module in a workbook. There is a Sub Main() procedure in that module that simply calls other procedures. It started out like this: Sub Main() Call Proc1 End Sub Sub Proc1() 'Run some code. End Sub I have a macro that runs overnight, which opens the workbook and runs Sub Main. It's all been working fine for about a week. Then I added to it to make it look something like: Sub Main() Call Proc1 If Weekday(Date) = 2 Then Call Proc2 End Sub Sub Proc1() 'Run some code. End Sub Sub Proc2() 'Run some other code. End Sub The idea is that the second procedure should only run on Monday. However, I was seeing unexpected results when I came in the next day. So I stepped through Sub Main. It totally skipped the first line and went directly to the If Weekday.... statement. I took out the Call and stepped through. It worked the way I wanted. It went to Proc1, ran that code, then came back and ran through the rest of Sub Main. What's going on, can anyone tell me? tod |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
3D chart - unusual | Charts and Charting in Excel | |||
Stop a Procedure from another procedure | Excel Discussion (Misc queries) | |||
Is there a simple procedure to hide rows if a condition is met | Excel Discussion (Misc queries) | |||
Is there a simple procedure to set my macros in Excel 2003 to be . | New Users to Excel |