View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Howard Howard is offline
external usenet poster
 
Posts: 536
Default Name the range AFTER copied to new sheet

On Tuesday, February 26, 2013 3:35:32 PM UTC-8, GS wrote:
Example...



Sub AddDefinedName(ByVal sName$, sRefersTo$, _

Optional IsLocal As Boolean = True)

Dim oScope As Object

If IsLocal Then

oScope = ActiveSheet: sName = "'" & oScope.Name & "'!" & sName

Else

oScope = ActiveWorkbook

End If ᅵsLocal

oScope.Names.Add sName, RefersTo:= sRefersTo

End Sub



--

Garry



Free usenet access at http://www.eternal-september.org

Classic VB Users Regroup!

comp.lang.basic.visual.misc

microsoft.public.vb.general.discussion


Garry,
I pasted your example and this line errored out in red:

End If ᅵsLocal

Even had it not errored it's beyond my pay grade of understanding.

I'll probably just have to go to the copy-to sheet and select and name them manually.

I do appreciate your time trying to beat it into my thick skull.

Thanks,
Howard