Ironman
Well-known Member
- Joined
- Jan 31, 2004
- Messages
- 1,069
- Office Version
- 365
- Platform
- Windows
Hi
I seem to have the correct number of 'End If''s in the below code, but I'm still getting the 'End If Without Block If' error message.
Help would be appreciated.
Many thanks!
I seem to have the correct number of 'End If''s in the below code, but I'm still getting the 'End If Without Block If' error message.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim b As Integer
b = Range("E5").Value Mod 100 'every 100 sessions
If b = 100 - 1 And Range("F3") = "" Then MsgBox "The next session will be your " & Format(Range("E5").Value + 1, "#,##0") & "th session on the bike", vbInformation, "Approaching " & Format(Range("E5").Value + 1, "#,##0") & " Bike Sessions"
Range("F3") = "1"
End If
If b = 0 Then MsgBox "Congratulations! You have just completed your " & Format(Range("E5").Value - b, "#,##0") & "th session!", vbInformation, "Bike Sessions Completed"
Range("F3") = "1"
End If
Application.ScreenUpdating = True
End Sub
Many thanks!