Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Change range name

I have a series of dynamic range names (i.e.. PX1, PX2, PX3, PX4, ect). I
want to set up a loop to use each range name. I tried something like this
which does not work:


Dim RngNbr As Integer, iRow As Integer
RngNbr = 1
Sheets("HistData").Select
'Select range PX1, PX2, PX3, PX4 by changing the value of RngNbr
Set pxRge = Range("PX & RngNbr")

ActiveSheet.ChartObjects("Chart 41").Activate
With ActiveChart.Axes(xlValue)
.MinimumScale = 0.97 *
Application.WorksheetFunction.Min(pxRge)
.Crosses = xlCustom
.CrossesAt = 0
.ReversePlotOrder = False
.ScaleType = xlLinear
End With

Any ideas? I would also like the select different charts with a similar
method.
--

Al Eaton



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Change range name

No obvious reason that shouldn't work. If you defined a name as PX1 in the
activeworkbook, then

i = 1
set rng = range("PX" & i)


should work fine.

--
Regards,
Tom Ogilvy


"Al Eaton" wrote in message
...
I have a series of dynamic range names (i.e.. PX1, PX2, PX3, PX4, ect). I
want to set up a loop to use each range name. I tried something like this
which does not work:


Dim RngNbr As Integer, iRow As Integer
RngNbr = 1
Sheets("HistData").Select
'Select range PX1, PX2, PX3, PX4 by changing the value of RngNbr
Set pxRge = Range("PX & RngNbr")

ActiveSheet.ChartObjects("Chart 41").Activate
With ActiveChart.Axes(xlValue)
.MinimumScale = 0.97 *
Application.WorksheetFunction.Min(pxRge)
.Crosses = xlCustom
.CrossesAt = 0
.ReversePlotOrder = False
.ScaleType = xlLinear
End With

Any ideas? I would also like the select different charts with a similar
method.
--

Al Eaton





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can change range to select active rows instead of :=Range("S10 ldiaz Excel Discussion (Misc queries) 7 August 29th 08 03:52 PM
Change the Range refering to a Name TonTon165 Excel Discussion (Misc queries) 2 June 27th 06 03:28 PM
How do I change a range name back to the underlying data range? Colin Excel Worksheet Functions 1 September 26th 05 05:55 PM
How do I change the range? sonar Excel Worksheet Functions 2 September 3rd 05 11:26 AM
how to change range in VBA? Nazrul Excel Programming 2 October 18th 03 03:29 PM


All times are GMT +1. The time now is 04:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"