View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
dok112[_31_] dok112[_31_] is offline
external usenet poster
 
Posts: 1
Default Macro within a Macro help


Hello,

I am creating a macro, that I am running into an error that I can'
figure out how to get around. The macro is basically determining whic
macro needs to be run on a form. Once it runs the necessary macro, i
is jumping onto the next, and then returning an error b/c it is no
supposed to be run. Here is my macro

Sub masteravail()
If WFM.Main1.Value = Sheets("WFM_Update").Range("N8") Then
Avail1
Exit Sub
End If
If WFM.Main1.Value = Sheets("WFM_Update").Range("N9") Then
Avail2
Exit Sub
End If
If WFM.Main1.Value = Sheets("WFM_Update").Range("N10") Then
Avail3
Exit Sub
End If
End Sub
-------------------------------------------------------------------------------
Sub Avail1()
If WFM.Week1.Value = "Sunday" Then
avail1a
Exit Sub
End If
If WFM.Week1.Value = "Monday" Then
avail1b
Exit Sub
End If
If WFM.Week1.Value = "Tuesday" Then
avail1c
Exit Sub
End If
If WFM.Week1.Value = "Wednesday" Then
avail1d
Exit Sub
End If
If WFM.Week1.Value = "Thursday" Then
avail1e
Exit Sub
End If
If WFM.Week1.Value = "Friday" Then
avail1f
Exit Sub
End If
If WFM.Week1.Value = "Saturday" Then
avail1g
Exit Sub
End If
End Sub


When it runs the macro "avail1a", it then attempts to run macr
"avail1b" even tho the exit sub command is there. How can I get aroun
this

--
dok11
-----------------------------------------------------------------------
dok112's Profile: http://www.excelforum.com/member.php...fo&userid=1058
View this thread: http://www.excelforum.com/showthread.php?threadid=26371