![]() |
create list from another worksheet
I have a worksheet with 2 columns of data that changes each day. I am
looking for a way to link / copy a certain row from the first worksheet to another worksheet on a daily basis -- I would need to do this with numerous rows into numerous worksheet. Example: bob 5 jim 6 frank 2 I need to link / copy (jim, 6) to worksheet jim. Each day I would like the newest row to appear at the top, and all the older data to move down a row. Can someone help me with the copying / links and moving the data down using a non-manual method? |
create list from another worksheet
Try this
Sub copyalltotheirsheets() For Each c In Range("a2:a" & Cells(Rows.Count, "a").End(xlUp).Row) With Sheets(CStr(c)) .Rows(2).Insert c.Resize(, 2).Copy .Range("a2") End With Next c End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Benjamin" wrote in message ... I have a worksheet with 2 columns of data that changes each day. I am looking for a way to link / copy a certain row from the first worksheet to another worksheet on a daily basis -- I would need to do this with numerous rows into numerous worksheet. Example: bob 5 jim 6 frank 2 I need to link / copy (jim, 6) to worksheet jim. Each day I would like the newest row to appear at the top, and all the older data to move down a row. Can someone help me with the copying / links and moving the data down using a non-manual method? |
create list from another worksheet
Assumes your list starting at row 2 of the workbook and worksheet you are on when the macro is fired. Put in a regular module of the activeworkbook. -- Don Guillett Microsoft MVP Excel SalesAid Software "Benjamin" wrote in message ... I'm new to code. Should I be inserting something in this? Which worksheet / book does it belong in? I am getting a Runtime Error "9" Subscript out of Range. "Don Guillett" wrote: Try this Sub copyalltotheirsheets() For Each c In Range("a2:a" & Cells(Rows.Count, "a").End(xlUp).Row) With Sheets(CStr(c)) .Rows(2).Insert c.Resize(, 2).Copy .Range("a2") End With Next c End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Benjamin" wrote in message ... I have a worksheet with 2 columns of data that changes each day. I am looking for a way to link / copy a certain row from the first worksheet to another worksheet on a daily basis -- I would need to do this with numerous rows into numerous worksheet. Example: bob 5 jim 6 frank 2 I need to link / copy (jim, 6) to worksheet jim. Each day I would like the newest row to appear at the top, and all the older data to move down a row. Can someone help me with the copying / links and moving the data down using a non-manual method? |
create list from another worksheet
OK. This works. Some more questions... The initial workbook will be new
everyday, and the copied rows will go into a different workbook. Where would I put the code in this case? I assume I would need to identify the workbook names in the code too? "Don Guillett" wrote: Assumes your list starting at row 2 of the workbook and worksheet you are on when the macro is fired. Put in a regular module of the activeworkbook. -- Don Guillett Microsoft MVP Excel SalesAid Software "Benjamin" wrote in message ... I'm new to code. Should I be inserting something in this? Which worksheet / book does it belong in? I am getting a Runtime Error "9" Subscript out of Range. "Don Guillett" wrote: Try this Sub copyalltotheirsheets() For Each c In Range("a2:a" & Cells(Rows.Count, "a").End(xlUp).Row) With Sheets(CStr(c)) .Rows(2).Insert c.Resize(, 2).Copy .Range("a2") End With Next c End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Benjamin" wrote in message ... I have a worksheet with 2 columns of data that changes each day. I am looking for a way to link / copy a certain row from the first worksheet to another worksheet on a daily basis -- I would need to do this with numerous rows into numerous worksheet. Example: bob 5 jim 6 frank 2 I need to link / copy (jim, 6) to worksheet jim. Each day I would like the newest row to appear at the top, and all the older data to move down a row. Can someone help me with the copying / links and moving the data down using a non-manual method? |
All times are GMT +1. The time now is 07:19 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com