Small macro intercepting the state of buttons in 'schedule group'
Option Explicit
Sub RGO()
If Application.Caller = "optM" Then
Sheet1.Range("H4:J6").ClearContents
If [I15] = 1 And [G15] = 1 Then [H4] = [B4]: [H5] = [B5]: [H6] = [B6]: [G3] = "Alpha"
If [I15] = 1 And [G15] = 2 Then [H4] = [B9]: [H5] = [B10]: [H6] = [B11]: [G3] = "Bravo"
If [I15] = 1 And [G15] = 3 Then [H4] = [B14]: [H5] = [B15]: [H6] = [B16]: [G3] = "Charlie"
End If
If Application.Caller = "optT" Then
Sheet1.Range("H4:J6").ClearContents
If [I15] = 2 And [G15] = 1 Then [I4] = [C4]: [I5] = [C5]: [I6] = [C6]: [G3] = "Alpha"
If [I15] = 2 And [G15] = 2 Then [I4] = [C9]: [I5] = [C10]: [I6] = [C11]: [G3] = "Bravo"
If [I15] = 2 And [G15] = 3 Then [I4] = [C14]: [I5] = [C15]: [I6] = [C16]: [G3] = "Charlie"
End If
If Application.Caller = "optW" Then
Sheet1.Range("H4:J6").ClearContents
If [I15] = 3 And [G15] = 1 Then [J4] = [D4]: [J5] = [D5]: [J6] = [D6]: [G3] = "Alpha"
If [I15] = 3 And [G15] = 2 Then [J4] = [D9]: [J5] = [D10]: [J6] = [D11]: [G3] = "Bravo"
If [I15] = 3 And [G15] = 3 Then [J4] = [D14]: [J5] = [D15]: [J6] = [D16]: [G3] = "Charlie"
End If
End Sub
Bookmarks