PDA

View Full Version : [SOLVED] Copy data from rows to other worksheets



podder
01-15-2018, 03:15 AM
Hi,
I have asked a similar question before but want to make the macro better so here goes.
I want to copy a row of data as such: Column D, E, F, H and I (omitting G). The rows are copied down to the last value in column D
The data must then go into the worksheet that is stated in Column A (tab name has been inserted into column A), these values must be pasted in Row 14A through to 14E in each worksheet.

Any help would be appreciated
Thanks

mana
01-15-2018, 05:45 AM
Option Explicit


Sub test()
Dim i As Long

For i = 1 To Range("D" & Rows.Count).End(xlUp).Row
With Rows(i)
.Range("d1:f1,h1:i1").Copy Sheets(.Range("a1").Text).Range("a14")
End With
Next

End Sub



マナ

podder
01-15-2018, 07:14 AM
Option Explicit


Sub test()
Dim i As Long

For i = 1 To Range("D" & Rows.Count).End(xlUp).Row
With Rows(i)
.Range("d1:f1,h1:i1").Copy Sheets(.Range("a1").Text).Range("a14")
End With
Next

End Sub



マナ
Thanks Mana - as usual it worked perfectly