Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to create a named range from an area that is still highlighted from a
copy paste special code before I lose the cell id. Is this possible? Jim at Eagle |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim,
Yes ... for example ... Range("A1:A10").Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False ' this names the range from the copy/pastespecial i.e. A1:A10 to "MyName" ActiveWorkbook.Names.Add Name:="MyName", RefersToR1C1:="=Sheet1!R1C1:R10C1" HTH "Jim at Eagle" wrote: I need to create a named range from an area that is still highlighted from a copy paste special code before I lose the cell id. Is this possible? Jim at Eagle |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks,
cutcopymode:=false causes the focus to close on the range that was established with the paste, leaving me needing to recreate the range. This sheet3 will have 100 different range names created and the code ="=sheet1!R1C1:R10C1" will not allow for a unique name range creation. ' Locate for next copy & paste Sheets("Storage1").Select Sheets("Storage1").Range("A65535").End(xlUp).Offse t(1, 0).Select Application.Goto Reference:="InvoiceBlk" Selection.Copy Sheets("Storage1").Select Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, _ Operation:=xlNone, SkipBlanks:=False, Transpose:=False Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Selection.PasteSpecial Paste:=xlPasteColumnWidths, _ Operation:=xlNone, SkipBlanks:=False, Transpose:=False 'Here is where the range is still in shade mode and I need to be 'able to assign a unique name to the area before lost of focus. Application.CutCopyMode = False "Toppers" wrote: Jim, Yes ... for example ... Range("A1:A10").Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False ' this names the range from the copy/pastespecial i.e. A1:A10 to "MyName" ActiveWorkbook.Names.Add Name:="MyName", RefersToR1C1:="=Sheet1!R1C1:R10C1" HTH "Jim at Eagle" wrote: I need to create a named range from an area that is still highlighted from a copy paste special code before I lose the cell id. Is this possible? Jim at Eagle |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Użytkownik "Jim at Eagle" napisał w wiadomości ... I need to create a named range from an area that is still highlighted from a copy paste special code before I lose the cell id. Is this possible? Jim at Eagle if its still selected from copy mode you can try ActiveWorkbook.Names.Add Name:="your_name", RefersToR1C1:=Selection you should add a number to your named range to have it done automatically like i=1 ...... i=i+1 mcg |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That worked. Every stored invoice on sheet4 is assigned the invoice number.
Locating the range by the named allows viewing and printing. The code you supplied will only work if sheet4 is selected. So range name is sheet specific. Thanks, now I can move on with frustrating myself further. Thanks again "Macgru" wrote: UÂżytkownik "Jim at Eagle" napisaÂł w wiadomoÂści ... I need to create a named range from an area that is still highlighted from a copy paste special code before I lose the cell id. Is this possible? Jim at Eagle if its still selected from copy mode you can try ActiveWorkbook.Names.Add Name:="your_name", RefersToR1C1:=Selection you should add a number to your named range to have it done automatically like i=1 ...... i=i+1 mcg |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Użytkownik "Jim at Eagle" napisał w wiadomości ... That worked. Every stored invoice on sheet4 is assigned the invoice number. Locating the range by the named allows viewing and printing. The code you supplied will only work if sheet4 is selected. So range name is sheet specific. Thanks, now I can move on with frustrating myself further. Thanks again "Macgru" wrote: U?ytkownik "Jim at Eagle" napisa3 w wiadomo?ci ... I need to create a named range from an area that is still highlighted from a copy paste special code before I lose the cell id. Is this possible? Jim at Eagle if its still selected from copy mode you can try ActiveWorkbook.Names.Add Name:="your_name", RefersToR1C1:=Selection you should add a number to your named range to have it done automatically like i=1 ...... i=i+1 mcg try then sheest(...).selection mcg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
nameing a worksheet | Excel Discussion (Misc queries) | |||
How do I prevent copy and pasting into a selected range of a works | Excel Discussion (Misc queries) | |||
column nameing | Excel Discussion (Misc queries) | |||
Programatically nameing ranges | Excel Programming | |||
How to Copy & Paste selected Range in Excel (MFC) | Excel Programming |