jondavis1987
Active Member
- Joined
- Dec 31, 2015
- Messages
- 443
- Office Version
- 2019
- Platform
- Windows
I have this vba for a command button. Cell D2 has a dropdown list that has the words "High", "Medium", "Low". The button will copy cells A2:C2 and paste the values in the last row. If D2 says High I'd like A2:C2 to be pasted into cells that are green, medium into yellow, and low into red. Any advice on how to alter this?
VBA Code:
Sub Log_Changes()
Dim lastRow As Long
Dim ws As String
Dim srcName As String
Dim wsName As String
ws = ActiveSheet.Name
Application.DisplayAlerts = False
lastRow = Sheets(ws).Cells(Rows.Count, "A").End(xlUp).Row + 1
Sheets(ws).Range("A2:C2").Copy
Sheets(ws).Range("A" & lastRow).PasteSpecial xlPasteValues
End Sub