Ironman
Well-known Member
- Joined
- Jan 31, 2004
- Messages
- 1,069
- Office Version
- 365
- Platform
- Windows
Hi
The below code in a worksheet_change event runs fine and I'm just trying to add a line to the end of it that makes Col C of the last filled row in sheet 'Training Log' the active cell, but what I've tried below isn't acceptable and I don't know how to overcome this.
Help would be appreciated.
Many thanks!
The below code in a worksheet_change event runs fine and I'm just trying to add a line to the end of it that makes Col C of the last filled row in sheet 'Training Log' the active cell, but what I've tried below isn't acceptable and I don't know how to overcome this.
VBA Code:
If Range("CurYTD").Value > Range("CurGoal").Value Then
MsgBox ("Congratulations!" & vbNewLine & "You have now run more miles this year than" & vbNewLine & vbNewLine & _
"- The whole of " & Range("PreYear").Value & vbNewLine & _
"- " & Range("counter").Value & " of the " & Year(Now) - 1981 & " years you've been running" & vbNewLine & _
vbNewLine & "New rank for " & Year(Now) & " is " & Range("CurYTD").Offset(1, 0).Value & " out of " & Year(Now) - 1981), _
vbInformation, "Another Year End Mileage Total Exceeded! "
Range("Counter").Value = Range("Counter").Value + 1
Else
MsgBox (CLng(Range("CurGoal").Value - Range("CurYTD").Value) & _
" miles to go until rank " & (Range("CurYTD").Offset(1, 0).Value) - 1 & " reached" & vbNewLine & vbNewLine & _
"(Year end mileage for " & Range("PreYear").Value & ")"), _
vbInformation, "Year To Date Mileage"
End If
Application.ScreenUpdating = True
Application.EnableEvents = True
End If
Sheets("Training Log").Range("A23358").End(xlUp).Offset(1, 0).Select (the column and possibly the row are incorrect but I don't know what they should be)
Application.Calculation = xlCalculationAutomatic
End Sub
Many thanks!
Last edited: