The 2nd line of code below is throwing the abovementioned error:
Dim rng As String
rng = Range(Cells(2, 1), Cells(4000, 302)).Address
*302nd column is fixed and is the end column of the selection that I must copy.
What I find odd is replacing 302 with 255 or below gets rid of the error and enables my program to work.
Another thing I do not understand is; using the immediate window ---- having 255 on the column parameter prints $A$2:$IU$4000, as it should. However, replacing it with 256 throws $2:$4000 whereas I believe it should be $A$2:$IV$4000. Any number above results to the same error.
What am I missing here?
IV(which should be 256), so 302 would be out-of-range.IV(256) is the last column, selecting$A$2:$IV$4000is actually seleting$2:$4000(full row selection).