Hello everyone,
I'm working on a simple automation to copy paste value from a worksheet to another worksheet. I'm not really an expert in VBA and I'm currently stuck in copying the first row of worksheet after the columns have been filtered.
As you can see below, I would like to copy the first row below to another worksheet and in a specific cells.
*To a different worksheet and in specific cells*
the VBA code I'm using is a standard code as per below.
Code
Sub Copy_First_Row()
'First step: Once filter, copy the cell respectively to another cell in another worksheet
Sheets("Hospital Info").Range("A2").Copy Destination:=Sheets("template").Range("B9")
Sheets("Hospital Info").Range("B2").Copy Destination:=Sheets("template").Range("B10")
Sheets("Hospital Info").Range("C2").Copy Destination:=Sheets("template").Range("B11")
Sheets("Hospital Info").Range("D2").Copy Destination:=Sheets("template").Range("B12")
Sheets("Hospital Info").Range("E2").Copy Destination:=Sheets("template").Range("B14")
Sheets("Hospital Info").Range("F2").Copy Destination:=Sheets("template").Range("B15")
Sheets("Product List").Range("A2").Copy Destination:=Sheets("template").Range("B20")
Sheets("Product List").Range("B2").Copy Destination:=Sheets("template").Range("C20")
End Sub
Display More
How can I add to take the filtered first row only and the copy paste it to the other worksheet if we are using my code above?
Thanks!