PC Review


Reply
 
 
=?Utf-8?B?bWFyaw==?=
Guest
Posts: n/a
 
      24th Jun 2007
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
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      24th Jun 2007
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
 
Reply With Quote
 
=?Utf-8?B?bWFyaw==?=
Guest
Posts: n/a
 
      24th Jun 2007
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Define name David Microsoft Excel Programming 4 9th Mar 2006 09:19 PM
define name =?Utf-8?B?c3Vuc2hpbmU=?= Microsoft Excel Misc 1 29th Mar 2005 01:37 AM
Define Value Fernando Peixito Microsoft Access Macros 1 3rd Feb 2004 11:50 AM
#define A.M Microsoft C# .NET 3 13th Jan 2004 08:31 PM
How to define this.... Alex Sanchez. Microsoft C# .NET 1 21st Nov 2003 04:53 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:59 PM.