Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default looping through an array of ranges

I am trying this code but am getting message, "can't assign to array" and the
RangeVY is highlighted (see after @) any help on looping through many arrays
would be appreciated. thanx

' I also tried Dim RangeVY As varient but got user defined type not
defined

Dim RangeVY(3) As Range
@RangeVY = Array("V2", "W2", "X2", "Y2")

For i = LBound(RangeVY) To UBound(RangeVY)
Do Until ActiveCell.Offset(0, 0) = ""
Call DR6_Variances_Calculations_Subroutine_1
Loop

Sub DR6_Variances_Calculations_Subroutine_1()

ActiveCell.FormulaR1C1 = "=ROUND(RC[-10]-RC[-5],2)"
ActiveCell.Offset(1, 0).Select

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default looping through an array of ranges

Try:

Dim RangeVY()
RangeVY = Array("V2", "W2", "X2", "Y2")

Regards

Trevor


"Arnold Klapheck" wrote in
message ...
I am trying this code but am getting message, "can't assign to array" and
the
RangeVY is highlighted (see after @) any help on looping through many
arrays
would be appreciated. thanx

' I also tried Dim RangeVY As varient but got user defined type not
defined

Dim RangeVY(3) As Range
@RangeVY = Array("V2", "W2", "X2", "Y2")

For i = LBound(RangeVY) To UBound(RangeVY)
Do Until ActiveCell.Offset(0, 0) = ""
Call DR6_Variances_Calculations_Subroutine_1
Loop

Sub DR6_Variances_Calculations_Subroutine_1()

ActiveCell.FormulaR1C1 = "=ROUND(RC[-10]-RC[-5],2)"
ActiveCell.Offset(1, 0).Select

End Sub



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
LOOPING multiple ranges Jase Excel Discussion (Misc queries) 1 April 7th 08 06:21 PM
Looping through named ranges JFamilo[_12_] Excel Programming 2 August 17th 05 02:23 PM
Any easier way than looping on ranges Billabong Excel Programming 1 August 27th 04 10:32 AM
Looping through Ranges of Rows MS News Excel Programming 6 December 9th 03 06:13 AM
Looping through Ranges of Rows MS News Excel Programming 0 December 8th 03 11:42 AM


All times are GMT +1. The time now is 12:48 PM.

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"