Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Copy, Paste and Rename a Range using a macro

I have been attempting to copy, paste and rename a range using an
Excel macro. I have a specific line that I want the new range copied
to in each instance (a line with a named range for a cell) and so far
I have this:

Sub Add_Task()
'
' Add_Task Macro
'

'
Range("Task1").Select
Selection.Copy
Range("LaborTotals").Offset(-1, 0).Select
Selection.Insert Shift:=xlDown
End Sub

I cannot get the range to rename and I cannot get a blank row between
the first range and the second. Can someone assist? Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default Copy, Paste and Rename a Range using a macro

Hi,

What you need to do is make the name of the range dynamic. Go to Insert --
Name and then define. Name your range "Labour Totals"

And then in the refers to:

=OFFSET($A$1,0,0,COUNTA($A:$A),1)

or what ever the left column of the range is.

" wrote:

I have been attempting to copy, paste and rename a range using an
Excel macro. I have a specific line that I want the new range copied
to in each instance (a line with a named range for a cell) and so far
I have this:

Sub Add_Task()
'
' Add_Task Macro
'

'
Range("Task1").Select
Selection.Copy
Range("LaborTotals").Offset(-1, 0).Select
Selection.Insert Shift:=xlDown
End Sub

I cannot get the range to rename and I cannot get a blank row between
the first range and the second. Can someone assist? Thanks.

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 REQ: Automatically copy a template sheet and rename MCSmarties Excel Worksheet Functions 5 October 11th 07 09:18 PM
Macro - copy a range and paste it in a new sheet 12 times Eva Excel Worksheet Functions 0 September 26th 07 07:20 PM
Copy range in macro using paste special values Jeff Excel Discussion (Misc queries) 2 August 20th 07 08:12 PM
Macro to copy, paste in a range and then delete Garry Excel Discussion (Misc queries) 0 March 23rd 06 07:37 PM
Copy/Paste using a macro that identifies occuoied range JorgeAE Setting up and Configuration of Excel 1 March 13th 06 12:51 AM


All times are GMT +1. The time now is 04:23 AM.

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

About Us

"It's about Microsoft Excel"