Copy from 1 worksheet to multipule worksheets based upon worksheetname

  • Thread starter Thread starter bbhighfi
  • Start date Start date
B

bbhighfi

HELP!

Goal: seeking to have a row of data in "sheet1" which has a unique
indentifier in cell D6 copy and pasted to a worksheeting within the
same workbook that matches the uniquie indentifier in Cell D6. I would
like this to loop through to the end of the 30 or so records.

Current Code: I have this macro repeating thirty times, but does not
allow for any new additions to the "sheet1" data rows (ie, if I delete
one item and replace it with a new identifier)

Sheets("sheet1").Activate
Range("G7:K7").Select
Selection.Copy
Sheets("DAVE").Select
Range("B7").Select
ActiveSheet.Paste

My Flustration: tying the identifer, which is not copied to the
individual worksheet to the worksheet which matches the identifer and
having the process loop though all records, copy the data from g:k and
then deposit that data into the correct sheet (in the case above, its
"DAVE").

hope this makes sense, Happy New year to all. Thanks.
 
There is some additional information that is needed for an efficient
and robust solution: but, assuming that your "identifiers" in column D
are in rows 1 through 6 and you always want the data from sheet1 to go
to row 7 of the identified sheet, the following should get you
started:

Sub test()

For i = 1 To 6
For j = 8 To 11
Worksheets(Cells(i, 4).Value).Cells(7, j).Value = Cells(i,
j).Value
Next j
Next i

End Sub

If the sheet does not exist you will get an error.

Good luck.

Ken
Norfolk, Va.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top