Hi!
I need the code to match input value then copy data only the header show in sheet2.
But my code copy entire row and place them in the same row on sheet2 after executing.
This my data with many column and row the source data is in the column G.
Copy from sheet1 to sheet2 by match the header after click find. Like this picture.
I need the code to match input value then copy data only the header show in sheet2.
But my code copy entire row and place them in the same row on sheet2 after executing.
This my data with many column and row the source data is in the column G.
Copy from sheet1 to sheet2 by match the header after click find. Like this picture.
VBA Code:
Option Explicit
Sub Test()
Dim Cell As Range
With Sheets(1)
''''' loop column G untill last cell with value
For Each Cell In .Range("G1:G" & .Cells(.Rows.Count, "G").End(xlUp).Row)
If Cell.Value = "NB016" Then
' Copy>>Paste
.Rows(Cell.Row).Copy Destination:=Sheets(2).Rows(Cell.Row)
End If
Next Cell
End With
End Sub