View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Andrew Taylor Andrew Taylor is offline
external usenet poster
 
Posts: 225
Default Sequentially run macros

You can't nest Subs/Functions in the way you tried.
Just do this:

Option Explicit
Function Main_update() ' Sub might be more logical
Update_IMR
Update_Profile
' any other subs you want to run
End Function

Sub Update_IMR()
....Code...
End Sub

Sub Update_Profile
....Code...
End Sub




CurtH wrote:
I have several macros which in a module. I tried adding a Function state
with the various subs in between ended by a END Function. It doesn't work.
Does anyone have any suggestions? The code is like thus:

Option Explicit

Function Main_update()

Sub Update_IMR()
...Code...
End Sub
Sub Update_Profile
...Code...
End Sub
End Funtion

Please advise.