Hi all,
I've to sheets [Sheet1 & Sheet3] in the first sheet I used a macro to copy rows to sheet3 based on cell input from dropdown list. The code works, so that whenever they select [High] rating, that whole row will be copied to the other sheer.
The only problem I have is that whenever I go back and change rating from High to Low, Medium or delete the rating, that change doesn’t reflect on Sheet3. I need whenever the change the rating the macro should go back and delete the equivalent row from sheet3 that was copied there previously.
This is the macro I used:
I hope I made it clear. attached is an example of the workbook.Private Sub Worksheet_Change(ByVal Target As Range)
' Code goes in the Worksheet specific module
Dim rng As Range
' Set Target Range, i.e. Range("A1, B2, C3"), or Range("A1:B3")
Set rng = Target.Parent.Range("D:D")
' Only look at single cell changes
If Target.Count > 1 Then Exit Sub
' Only look at that range
If Intersect(Target, rng) Is Nothing Then Exit Sub
' Action if Condition(s) are met (do your thing here...)
If LCase(Target.Value) = "high" Then
With Target.EntireRow
.Copy Sheets("Sheet3").Cells(Rows.Count, "D").End(xlUp).Offset(1, -3)
End With
End If
End Sub
example.xlsm
Bookmarks