View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default Nameing a range while still selected from copy

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