ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   I need a macro to copy (https://www.excelbanter.com/excel-programming/325109-i-need-macro-copy.html)

PCOR

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



Edwin Tam[_7_]

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




PCOR

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






gocush[_29_]

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




PCOR

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






gocush[_29_]

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








All times are GMT +1. The time now is 03:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com