Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a Range Name Based on a Selected Range 1

Status
Not open for further replies.

Dauphy

IS-IT--Management
Joined
Nov 8, 2001
Messages
111
Location
CA
Hi!

I'm new to VBA; so please bear with me.

The user highlights a selection range; hits a button; and a chart appears. First things first - I'm struggling with assigning a named range based on the area that has been selected.

After I have obtained that named range; I need an offset range based on the first column selected. For example, if C4:D8 was selected; i need the value listed in C1; therefore I need to create a named range for this one too.

Once I have this; I'll be able to record my macro strokes for the rest of the chart.

Thank you.



 
I'm new to this too so I need to clarify what you are asking. Are you asking how to name a range of cells?

Thanks-
 
Dauphy,

Try this...


Sub Create_Names()
Selection.Name = "data"
ActiveCell.Select
Selection.Offset(-3, 0).Name = "heading"
End Sub


Hope it helps. Please advise as to how it fits.

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Perfect Dale!

Sorry SRogers; but thanks anyways :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top