I'm trying to write an efficient macro that first identifies 13 different named ranges of varying size (not single named cells, of which I also have many), then uses one range at a time for each of 13 iterations of the loop. The repetitive operation is to (1) copy a random draw value to each cell within the selected range, (2) call a separate macro, and (3) change each cells' contents back to the formula it was prior to (1). Then move to the next range and repeat. I'm getting better at declaring variables then using them with each visit to this forum, but I can't find a solution to this specific problem. Here's what I have thus far (and preemptive thanks!):
Sub blrp()
Dim MyRange(1 To 3) As Range
MyRange(1) = Sheets("Parameter Table").Range("blah1")
MyRange(2) = Sheets("Parameter Table").Range("blah2")
MyRange(3) = Sheets("Parameter Table").Range("blah3")
Dim i As Long
Dim MyRanges As Single
MyRanges = 3 'decreased from 13 for this post
For i = 1 To MyRanges
MyRange(i).Formula = "=VALUE(RC[5])"
Run blrpdrp
MyRange(i).Formula = "=IF(*abbreviated)
Next i
End Sub
Bookmarks