MichaelRed
Programmer
Why oh why this error?
With the code below (first box), I only ever get the "Subscript out of range error" (error 9). I have a break point on the FUNCTION declaration line, and it doesn't even get to this? The second code box below is from the imediate window, so the calculation of the range seems adequate. I can evemn comment out the entire content of the procesure and STILL get the same error!!!!!
MichaelRed
With the code below (first box), I only ever get the "Subscript out of range error" (error 9). I have a break point on the FUNCTION declaration line, and it doesn't even get to this? The second code box below is from the imediate window, so the calculation of the range seems adequate. I can evemn comment out the entire content of the procesure and STILL get the same error!!!!!
Code:
Public Function basMoveBulb()
Dim rngFrom As Range
Dim rngTo As Range
Dim RngColFrom As String
Dim RngColTo As String
Dim quo As String * 1
quo = Chr(34)
RngColFrom = "G"
RngColTo = "H"
Dim ColMax As Integer
Dim Idx As Integer
ColMax = 714
Idx = 1
With Application.ActiveSheet
For Idx = 1 To ColMax
rngFrom = (quo & RngColFrom & ":" & Idx & quo)
Debug.Print rngFrom
Stop
Idx = Idx + 1
Next
End With
Code:
Idx = 1
Quo = """
rngColFrom = "G"
rngFrom = (quo & RngColFrom & ":" & Idx & quo)
? rngFrom
"G:1"
MichaelRed