Ironman
Well-known Member
- Joined
- Jan 31, 2004
- Messages
- 1,069
- Office Version
- 365
- Platform
- Windows
Hi
I keep getting "Compile Error: End If without Block If" when I try to add the commented code to the existing code below it
Help would be much appreciated.
Thank you!
I keep getting "Compile Error: End If without Block If" when I try to add the commented code to the existing code below it
VBA Code:
If Date = DateSerial(Year(Now), 1, 1) Then
'MsgBox "Training Log code: Uncomment (reactivate) Important Messages " & vbNewLine _
'& "For Training Log F9 (Iron Man Runs This Year vs Last Year)", vbInformation, "New Year Update"
'Else
'End If
Dim DummyRow As Long
With Sheets("Walking")
DummyRow = .Range("A" & Rows.Count).End(xlUp).Row + 1
If .Range("A" & DummyRow - 1).Value = Date Then Exit Sub
.Range("A" & DummyRow).Value = Date
.Range("B" & DummyRow).Value = "DUMMY ENTRY TO AVOID #REF! ERROR IN THIS SHEET AND TRAINING LOG J9 - OVERTYPE THIS ROW!"
Range("B" & DummyRow).HorizontalAlignment = xlLeft
.Range("B" & DummyRow).WrapText = True
.Range("A" & DummyRow & ":D" & DummyRow).Interior.Color = RGB(255, 255, 0)
.Range("A" & DummyRow).HorizontalAlignment = xlCenter
.Range("A" & DummyRow & ":D" & DummyRow).VerticalAlignment = xlCenter
.Range("A" & DummyRow & ":D" & DummyRow).Font.Name = "Comic Sans MS"
.Range("A" & DummyRow & ":D" & DummyRow).Font.Bold = True
.Range("A" & DummyRow & ":D" & DummyRow).Borders.LineStyle = xlContinuous
.Range("A" & DummyRow & ":D" & DummyRow).Font.Size = 9
.Range("C" & DummyRow).Value = "1:00"
.Range("C" & DummyRow).NumberFormat = "[h]:mm"
.Range("C" & DummyRow).HorizontalAlignment = xlCenter
.Range("D" & DummyRow).Value = "1.0"
.Range("D" & DummyRow).NumberFormat = "0.0"
.Range("D" & DummyRow).HorizontalAlignment = xlCenter
End With
End If
Help would be much appreciated.
Thank you!