Thread: Defining Names
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Matthew Connor Matthew Connor is offline
external usenet poster
 
Posts: 17
Default Defining Names

russell (skmr3) wrote:

Hi All,

<snip
Can anyone help me modify the below coding so the current
selection is defined?

ActiveWorkbook.Names.Add Name:="SuppTbl", _
RefersTo:=ActiveWorkbook.Worksheets("Supps").Selec tion

Thanks in advance.

Russell.

'Selection' is only available for the Application and Window objects.

Either:
ActiveWorkbook.Names.Add Name:="SuppTbl", _
RefersTo:=ActiveWindow.Selection

ActiveWorkbook.Names.Add Name:="SuppTbl", _
RefersTo:=Application.Selection

might suit your needs.

HTH,

Matthew Connor