I am very novice with VBA and have adapted what I would like to do from code on this forum and the internet. It all works except for if you click No on the "GO" part. I cannot figure out what is happening and would appreciate any help.
Craig
Sub CorpsChiefUpdate()
Dim GO As Integer
Dim CorpsChief As Integer
GO = MsgBox("Is the Corps Chief still a General Officer?", vbYesNo + vbQuestion, "Corps Chief")
If GO = vbYes Then
CorpsChief = MsgBox("Is the Corps Chief still: " & Sheets("Federal Holidays").Range("I1").Value, vbYesNo + vbQuestion, "Corps Chief")
If CorpsChief = vbYes Then
Else
If GO = vbNo Then
Sheets("Federal Holidays").Range("I1:I3").Clear
Else
If CorpsChief = vbNo Then
'Update Name
Dim Name As String
Name = InputBox("New Corps Chief's Name", "Corps Chief", "Rank Last Name")
Sheets("Federal Holidays").Range("I1").Value = Name
'Update DOB
Dim DOB As String
DOB = InputBox("New Corps Chief's DOB", "Corps Chief", "MM/DD/YYYY")
Sheets("Federal Holidays").Range("I2").Value = DOB
'Update Email Address
Dim Email As String
Email = InputBox("New Corps Chief's Email Address", "Corps Chief", "mail.mil")
Sheets("Federal Holidays").Range("I3").Value = Email
End If
End If
End If
End If
End Sub
Craig
Sub CorpsChiefUpdate()
Dim GO As Integer
Dim CorpsChief As Integer
GO = MsgBox("Is the Corps Chief still a General Officer?", vbYesNo + vbQuestion, "Corps Chief")
If GO = vbYes Then
CorpsChief = MsgBox("Is the Corps Chief still: " & Sheets("Federal Holidays").Range("I1").Value, vbYesNo + vbQuestion, "Corps Chief")
If CorpsChief = vbYes Then
Else
If GO = vbNo Then
Sheets("Federal Holidays").Range("I1:I3").Clear
Else
If CorpsChief = vbNo Then
'Update Name
Dim Name As String
Name = InputBox("New Corps Chief's Name", "Corps Chief", "Rank Last Name")
Sheets("Federal Holidays").Range("I1").Value = Name
'Update DOB
Dim DOB As String
DOB = InputBox("New Corps Chief's DOB", "Corps Chief", "MM/DD/YYYY")
Sheets("Federal Holidays").Range("I2").Value = DOB
'Update Email Address
Dim Email As String
Email = InputBox("New Corps Chief's Email Address", "Corps Chief", "mail.mil")
Sheets("Federal Holidays").Range("I3").Value = Email
End If
End If
End If
End If
End Sub