Ironman
Well-known Member
- Joined
- Jan 31, 2004
- Messages
- 1,069
- Office Version
- 365
- Platform
- Windows
Hi
The 2nd of the 2 worksheet change events below doesn't work (no VB error, it just doesn't run), but I can't see what I need to change/add to make both run.
I'd be grateful if this can be modified, possibly combining the 2 macros into one, so they will both run.
Many thanks!
The 2nd of the 2 worksheet change events below doesn't work (no VB error, it just doesn't run), but I can't see what I need to change/add to make both run.
VBA Code:
If Target.Column = 4 And Target.Row = Range("A" & Rows.Count).End(xlUp).Row Then
Lr1 = Target.Row
If Sheets("Training Log").Range("D" & Lr1).Value >= 0.0833 Then
Lr2 = Sheets("Iron Man Log").Range("A" & Rows.Count).End(xlUp).Row + 1
Sheets("Iron Man Log").Range("A" & Lr2).Value = Sheets("Training Log").Range("A" & Lr1).Value 'date
Sheets("Iron Man Log").Range("B" & Lr2).Value = Sheets("Training Log").Range("C" & Lr1).Value 'distance
Sheets("Iron Man Log").Range("C" & Lr2).Value = Sheets("Training Log").Range("D" & Lr1).Value 'time
End If
'MACRO 1 - COLUMN D
'Iron Man Bronze (2-3hrs)
If Sheets("Training Log").Range("D" & Lr1).Value >= 0.0833 And Sheets("Training Log").Range("D" & Lr1).Value < 0.1249 Then
Sheets("Training Log").Range("D" & Lr1).Resize(, 1).Interior.Color = RGB(255, 204, 153)
End If
'Iron Man Silver (3-3.5hrs)
If Sheets("Training Log").Range("D" & Lr1).Value >= 0.125 And Sheets("Training Log").Range("D" & Lr1).Value < 0.1458 Then
Sheets("Training Log").Range("D" & Lr1).Resize(, 1).Interior.Color = RGB(191, 191, 191)
End If
'Iron Man Gold (3.5hrs - 4hrs)
If Sheets("Training Log").Range("D" & Lr1).Value >= 0.1459 And Sheets("Training Log").Range("D" & Lr1).Value < 0.1665 Then
Sheets("Training Log").Range("D" & Lr1).Resize(, 1).Interior.Color = RGB(255, 204, 0)
End If
'Iron Man Platinum (4hrs+)
If Sheets("Training Log").Range("D" & Lr1).Value >= 0.1667 Then
Sheets("Training Log").Range("D" & Lr1).Resize(, 1).Interior.Color = RGB(242, 242, 242)
End If
End If
'MACRO 2 - COLUMN C
If Target.Column = 3 And Target.Row = Range("A" & Rows.Count).End(xlUp).Row Then
Lr3 = Target.Row
'Iron Man Bronze (9.9M - 13.1M)
If Sheets("Training Log").Range("C" & Lr3).Value >= 9.9 And Sheets("Training Log").Range("C" & Lr3).Value < 13.2 Then
Sheets("Training Log").Range("C" & Lr3).Interior.Color = RGB(255, 204, 153)
End If
'Iron Man Silver (13.2M - 15.0M)
If Sheets("Training Log").Range("C" & Lr3).Value >= 13.2 And Sheets("Training Log").Range("C" & Lr3).Value < 15.1 Then
Sheets("Training Log").Range("C" & Lr3).Interior.Color = RGB(191, 191, 191)
End If
'Iron Man Gold (15.1M - 16.9M)
If Sheets("Training Log").Range("C" & Lr3).Value >= 15.1 And Sheets("Training Log").Range("C" & Lr3).Value < 17 Then
Sheets("Training Log").Range("C" & Lr3).Interior.Color = RGB(255, 204, 0)
End If
'Iron Man Platinum (17M+)
If Sheets("Training Log").Range("C" & Lr3).Value >= 17 Then
Sheets("Training Log").Range("C" & Lr3).Interior.Color = RGB(242, 242, 242)
End If
End If
Many thanks!