Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
I need a macro to copy
I need a macro that will copy a given range and paste it. The range will vary It wll always start at A1 but may go to row 50 or 75 and col g or k or any other col. Also a macro that will copy all that is located on the sheet and paste it somewhere else Thanks .. -- Norton Professional 2004 says this email is clean...believe it |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
I need a macro to copy
Maybe this statement is what you need:
Sub copy_macro() ActiveSheet.UsedRange.Copy Worksheets(2).Range("A1") End Sub You can change the worksheets(2).range("A1") to other locations. Regards, Edwin Tam http://www.vonixx.com "PCOR" wrote: I need a macro that will copy a given range and paste it. The range will vary It wll always start at A1 but may go to row 50 or 75 and col g or k or any other col. Also a macro that will copy all that is located on the sheet and paste it somewhere else Thanks .. -- Norton Professional 2004 says this email is clean...believe it |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
I need a macro to copy
That woeked just GREAT
Now can you tell me how to do the same but to copy to that last ROW but to a given col(say Col K) Thanks much "Edwin Tam" wrote in message ... Maybe this statement is what you need: Sub copy_macro() ActiveSheet.UsedRange.Copy Worksheets(2).Range("A1") End Sub You can change the worksheets(2).range("A1") to other locations. Regards, Edwin Tam http://www.vonixx.com "PCOR" wrote: I need a macro that will copy a given range and paste it. The range will vary It wll always start at A1 but may go to row 50 or 75 and col g or k or any other col. Also a macro that will copy all that is located on the sheet and paste it somewhere else Thanks .. -- Norton Professional 2004 says this email is clean...believe it |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
I need a macro to copy
Sub copy_macro()
ActiveSheet.Range("A1").CurrentRegion.Copy Worksheets(2).Range("A1") End Sub This (CurrentRegion) will include all rows and columns from the starting point ( including rows above or below and columns to the left and right) until it finds a blank column or blank row. Hence you must not have extraneous data ADJACENT to the range you intend for this code. "Edwin Tam" wrote: Maybe this statement is what you need: Sub copy_macro() ActiveSheet.UsedRange.Copy Worksheets(2).Range("A1") End Sub You can change the worksheets(2).range("A1") to other locations. Regards, Edwin Tam http://www.vonixx.com "PCOR" wrote: I need a macro that will copy a given range and paste it. The range will vary It wll always start at A1 but may go to row 50 or 75 and col g or k or any other col. Also a macro that will copy all that is located on the sheet and paste it somewhere else Thanks .. -- Norton Professional 2004 says this email is clean...believe it |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
I need a macro to copy
Thanks a lot but.....
can you tell me how to do it for the following conditions: Copy from A1 to the last row(including the last row) there could be blanks in row 5 and 20 and to go to COL K Thanks again very much "gocush" /delete wrote in message ... Sub copy_macro() ActiveSheet.Range("A1").CurrentRegion.Copy Worksheets(2).Range("A1") End Sub This (CurrentRegion) will include all rows and columns from the starting point ( including rows above or below and columns to the left and right) until it finds a blank column or blank row. Hence you must not have extraneous data ADJACENT to the range you intend for this code. "Edwin Tam" wrote: Maybe this statement is what you need: Sub copy_macro() ActiveSheet.UsedRange.Copy Worksheets(2).Range("A1") End Sub You can change the worksheets(2).range("A1") to other locations. Regards, Edwin Tam http://www.vonixx.com "PCOR" wrote: I need a macro that will copy a given range and paste it. The range will vary It wll always start at A1 but may go to row 50 or 75 and col g or k or any other col. Also a macro that will copy all that is located on the sheet and paste it somewhere else Thanks .. -- Norton Professional 2004 says this email is clean...believe it |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
I need a macro to copy
Individual blank cells don't matter; it's a set of blank cells at the
perimeter that define or enclose Rng.CurrentRegion "PCOR" wrote: Thanks a lot but..... can you tell me how to do it for the following conditions: Copy from A1 to the last row(including the last row) there could be blanks in row 5 and 20 and to go to COL K Thanks again very much "gocush" /delete wrote in message ... Sub copy_macro() ActiveSheet.Range("A1").CurrentRegion.Copy Worksheets(2).Range("A1") End Sub This (CurrentRegion) will include all rows and columns from the starting point ( including rows above or below and columns to the left and right) until it finds a blank column or blank row. Hence you must not have extraneous data ADJACENT to the range you intend for this code. "Edwin Tam" wrote: Maybe this statement is what you need: Sub copy_macro() ActiveSheet.UsedRange.Copy Worksheets(2).Range("A1") End Sub You can change the worksheets(2).range("A1") to other locations. Regards, Edwin Tam http://www.vonixx.com "PCOR" wrote: I need a macro that will copy a given range and paste it. The range will vary It wll always start at A1 but may go to row 50 or 75 and col g or k or any other col. Also a macro that will copy all that is located on the sheet and paste it somewhere else Thanks .. -- Norton Professional 2004 says this email is clean...believe it |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro copy | Excel Discussion (Misc queries) | |||
Copy workbook, don't copy macro | Excel Discussion (Misc queries) | |||
how to count/sum by function/macro to get the number of record to do copy/paste in macro | Excel Programming | |||
Macro To Copy Down | Excel Programming |