Thread: copy macro help
View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Michael A Michael A is offline
external usenet poster
 
Posts: 48
Default copy macro help

Thank you everyone so much for your replies. I will try it now and report back.

"gocush" wrote:

Michael,
Try the following. Note: this should also have some error trapping to make
sure the cells in col B actually have a sheet with the same name ( no blanks
or typos)

Sub CopyToSheets()

Dim Rng As Range
Dim oCell As Range

Set Rng = Range("B1:B" & Cells(Rows.Count, "B").End(xlUp).Row)
For Each oCell In Rng
oCell.EntireRow.Copy _
Destination:=Sheets(oCell.Value).Range("A65536").E nd(xlUp).Offset(1,
0)
Next oCell


End Sub

"Michael A" wrote:

Anyhelp would be greatly appreciated..

I need a macro that will copy all the rows on a spreadsheet and send them to
the appropriate sheets based on the value in the B column in the row. For
example, B5 has value as "RES" so i want that row sent to the next available
row on the RES spread sheet. If it was "BOB" then i would want it sent to the
bob spreadsheet. Could someone please help me with this? Thank you!

I apolgize if this is a duplicate post. Ive tried to post several times and
hours later it hasn't showed up..

Thanks!