Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
what is the vb code to copy rows from one sheet to another?
Can someone please help tell me what is the correct syntax/ie vb code to copy a entire row from one sheet to another? Pretend I have two sheets and want to copy an entire row from sheet2 to sheet one , what is the code to do something like this? I know I can do it manually, but for what I am doing I need the macro code to do it automatically. Thanks -- bxc2739 ------------------------------------------------------------------------ bxc2739's Profile: http://www.excelforum.com/member.php...o&userid=32538 View this thread: http://www.excelforum.com/showthread...hreadid=545604 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
what is the vb code to copy rows from one sheet to another?
If you cant to copy everything (including formats):
Worksheets("Sheet2").Rows(10).Copy _ dest:=Worksheets("Sheet1").rows(10) To copy values only: Worksheets("Sheet1").rows(10).value = _ Worksheets("Sheet2").Rows(10).Value HTH -- AP "bxc2739" a écrit dans le message de news: ... Can someone please help tell me what is the correct syntax/ie vb code to copy a entire row from one sheet to another? Pretend I have two sheets and want to copy an entire row from sheet2 to sheet one , what is the code to do something like this? I know I can do it manually, but for what I am doing I need the macro code to do it automatically. Thanks -- bxc2739 ------------------------------------------------------------------------ bxc2739's Profile: http://www.excelforum.com/member.php...o&userid=32538 View this thread: http://www.excelforum.com/showthread...hreadid=545604 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
what is the vb code to copy rows from one sheet to another?
You gonna be pasting at the bottom of a group of rows???
Can you pick out a column that has data in it if that row is used? dim myCell as range dim NextRow as long dim DestCell as range with worksheets("sheet1") set mycell = .range("b72") 'some cell end with with worksheets("sheet2") nextrow = .cells(.rows.count,"G").end(xlup).row + 1 set destcell = .cells(nextrow,"A") end with mycell.entirerow.copy _ destination:=destcell bxc2739 wrote: Can someone please help tell me what is the correct syntax/ie vb code to copy a entire row from one sheet to another? Pretend I have two sheets and want to copy an entire row from sheet2 to sheet one , what is the code to do something like this? I know I can do it manually, but for what I am doing I need the macro code to do it automatically. Thanks -- bxc2739 ------------------------------------------------------------------------ bxc2739's Profile: http://www.excelforum.com/member.php...o&userid=32538 View this thread: http://www.excelforum.com/showthread...hreadid=545604 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Lookup function and compare | Excel Discussion (Misc queries) | |||
resetting last cell | Excel Discussion (Misc queries) | |||
Formula to copy rng of cells where (value is met) to anther sheet | Excel Worksheet Functions | |||
Copy an additional row based on another sheet | Excel Discussion (Misc queries) | |||
Adding Rows to Master Sheet | New Users to Excel |