I am receiving an error message "Constant Expression Required" from the following code:
I do not feel that this range is varying since the used range on that sheet is not changing during code execution. I do want the array to be able to by dynamic and respond to however many rows are in the "Instr List" worksheet. Is there a better way of counting the number of rows used on that sheet that would avoid this error?
Code:
num_xmitters = ThisWorkbook.Worksheets("Instr List").UsedRange.Rows.Count
Dim TransmitterArray(1 To 4, 1 To num_xmitters) As Range
I do not feel that this range is varying since the used range on that sheet is not changing during code execution. I do want the array to be able to by dynamic and respond to however many rows are in the "Instr List" worksheet. Is there a better way of counting the number of rows used on that sheet that would avoid this error?