Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
define name
Selection.CurrentRegion.Select
Selection.CreateNames Top:=True, Left:=False, Bottom:=False, Right:=False The above code define the names of the top colums in my selection - but it does that for the wotksheet level - I will need to have that define locally for the sheet only. Any idea? M |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
define name
It doesn't look like there's an option that allows you to make the names local.
But you could do it with something like: Option Explicit Sub testme01() Dim myRng As Range Dim myCol As Range Set myRng = Selection.CurrentRegion For Each myCol In myRng.Columns With myCol .Resize(.Rows.Count - 1, 1).Offset(1, 0).Name _ = "'" & .Parent.Name & "'!" & .Cells(1).Value End With Next myCol End Sub mark wrote: Selection.CurrentRegion.Select Selection.CreateNames Top:=True, Left:=False, Bottom:=False, Right:=False The above code define the names of the top colums in my selection - but it does that for the wotksheet level - I will need to have that define locally for the sheet only. Any idea? M -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
define name
Thank you
Option Explicit Sub testme01() Dim myRng As Range Dim myCol As Range Set myRng = Selection.CurrentRegion For Each myCol In myRng.Columns With myCol .Resize(.Rows.Count - 1, 1).Offset(1, 0).Name _ = "'" & .Parent.Name & "'!" & .Cells(1).Value End With Next myCol End Sub mark wrote: Selection.CurrentRegion.Select Selection.CreateNames Top:=True, Left:=False, Bottom:=False, Right:=False The above code define the names of the top colums in my selection - but it does that for the wotksheet level - I will need to have that define locally for the sheet only. Any idea? M -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Define a Value | Excel Worksheet Functions | |||
Define name | Excel Programming | |||
Name Define | Excel Discussion (Misc queries) | |||
define name | Excel Discussion (Misc queries) | |||
Name define | Excel Programming |