I can't seem to get the union to work in the following (it fails with error "Method 'Range' of Object '_Global' failed" at the union line):
[vba]
Function SettingRange(ShockNumber As Long, ParameterNumber As Long, MaxRow As Variant) As Range
Dim iRow As Long
Dim myRange As Range
ParameterNumber = ParameterNumber + 9
For iRow = 2 + ShockNumber To MaxRow Step 7
Set myRange = Application.Union(myRange, Range(Cells(iRow, ParameterNumber)))
Next iRow
Set SettingRange = myRange
End Function
[/vba]
Any clues?
-Matt