Snake Eyes
Board Regular
- Joined
- Dec 14, 2010
- Messages
- 103
- Office Version
- 365
- 2016
- Platform
- Windows
I have two macros that each have a Yes/No text box.
I would like to call Macro 2 from within Macro 1 however, in doing so, eliminate the Yes/No portion of Macro 2.
The catch is that Macro 2 needs to retain it's own Yes/No VB code since it can be run on it's own as well.
As you can see in Macro 1, I will ultimately be using the solution to actually call 3 macros from Macro 1.
Macro 1:
Macro 2
I would like to call Macro 2 from within Macro 1 however, in doing so, eliminate the Yes/No portion of Macro 2.
The catch is that Macro 2 needs to retain it's own Yes/No VB code since it can be run on it's own as well.
As you can see in Macro 1, I will ultimately be using the solution to actually call 3 macros from Macro 1.
Macro 1:
VBA Code:
Sub ClearALLSection_11()
'
' ClearALLSection_11
Application.GoTo Reference:=("Section11_Position, Section11_Options, Section11_OptionsNotes")
' YesNoMessageBox()
Dim Answer As String
Dim MyNote As String
'Place your text here
MyNote = "Do you really want to Clear the ALL Entries in Section 11?"
'Display MessageBox
Answer = MsgBox(MyNote, vbQuestion + vbYesNo, "Clear All Entries in Section 11?")
If Answer = vbNo Then
Application.GoTo Reference:="Section11_PositionHome"
End If
If Answer = vbYes Then
Selection.ClearContents
Macro 2
VBA Code:
Sub ClearPosition_11()
'
' ClearPosition_11 Macro
Application.GoTo Reference:="Section11_Position"
' YesNoMessageBox()
Dim Answer As String
Dim MyNote As String
'Place your text here
MyNote = "Do you really want to Clear the POSITION Entries in Section 11?"
'Display MessageBox
Answer = MsgBox(MyNote, vbQuestion + vbYesNo, "Clear POSITION Entries in Section 11?")
If Answer = vbNo Then
Application.GoTo Reference:="Section11_PositionHome"
End If
If Answer = vbYes Then
Selection.ClearContents