Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro REQ: Automatically copy a template sheet and rename | Excel Worksheet Functions | |||
Macro - copy a range and paste it in a new sheet 12 times | Excel Worksheet Functions | |||
Copy range in macro using paste special values | Excel Discussion (Misc queries) | |||
Macro to copy, paste in a range and then delete | Excel Discussion (Misc queries) | |||
Copy/Paste using a macro that identifies occuoied range | Setting up and Configuration of Excel |