Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro copy puiuluipui Excel Discussion (Misc queries) 6 September 5th 09 11:57 AM
Copy workbook, don't copy macro CongroGrey Excel Discussion (Misc queries) 1 June 13th 08 04:56 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM
Macro To Copy Down Jamesa Excel Programming 3 September 18th 03 01:30 PM


All times are GMT +1. The time now is 02:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"