View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
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