It will be in sheet1 (“B” column)where will this active list dropdown be. Will you just copy the row that has active.
Sub CopyData()
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Set ws1 = ThisWorkbook.Sheets("Sheet2")
Set ws2 = ThisWorkbook.Sheets("Active list")
ws2.Range("B2:D" & ws2.Rows.Count).ClearContents
'Check the value of column B in sheet 1
For i = 2 To ws1.Range("B" & ws1.Rows.Count).End(xlUp).Row
If ws1.Cells(i, 2).Value = "Active" Then
'Copy column D, E, F from sheet 1 to column B, C, D in sheet 2
ws1.Range(ws1.Cells(i, 4), ws1.Cells(i, 6)).Copy _
Destination:=ws2.Cells(ws2.Range("B" & ws2.Rows.Count).End(xlUp).Row + 1, 2)
End If
Next i
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Call CopyData
End Sub
Thank you aaewalshVBA Code:Sub CopyData() Dim ws1 As Worksheet Dim ws2 As Worksheet Set ws1 = ThisWorkbook.Sheets("Sheet2") Set ws2 = ThisWorkbook.Sheets("Active list") ws2.Range("B2:D" & ws2.Rows.Count).ClearContents 'Check the value of column B in sheet 1 For i = 2 To ws1.Range("B" & ws1.Rows.Count).End(xlUp).Row If ws1.Cells(i, 2).Value = "Active" Then 'Copy column D, E, F from sheet 1 to column B, C, D in sheet 2 ws1.Range(ws1.Cells(i, 4), ws1.Cells(i, 6)).Copy _ Destination:=ws2.Cells(ws2.Range("B" & ws2.Rows.Count).End(xlUp).Row + 1, 2) End If Next i End Sub
VBA Code:Private Sub Worksheet_SelectionChange(ByVal Target As Range) Call CopyData End Sub
Thank you aaewalsh
Issue solved thank u