P
pokdbz
I have the VBA code listed below.
I get an error Run-time error 1004
Method 'Range' of object '_Global' failed
Basicly what I want to do is select all rows with Column C = Independent
When I run it with lengthofselect = 79340 the error occurs on the
Range(RowNumHolderNew).Select statment
When I run it with lengthofselect = 16 it runs fine and selects the Rows I
want it to.
Is there a limit that you can only select so many rows at once in the
Range() function?
Do you have a simpler way of doing this?
i = 1
Do While Range("C" & i) <> ""
If Range("C" & i).Value = "Independent" Then
RowNumHolder = i & ":" & i & "," & RowNumHolder
End If
i = i + 1
Loop
lengthofselect = Len(RowNumHolder)
RowNumHolderNew = Mid(RowNumHolder, 1, lengthofselect - 1) 'removes last
comma
Range(RowNumHolderNew).Select
I get an error Run-time error 1004
Method 'Range' of object '_Global' failed
Basicly what I want to do is select all rows with Column C = Independent
When I run it with lengthofselect = 79340 the error occurs on the
Range(RowNumHolderNew).Select statment
When I run it with lengthofselect = 16 it runs fine and selects the Rows I
want it to.
Is there a limit that you can only select so many rows at once in the
Range() function?
Do you have a simpler way of doing this?
i = 1
Do While Range("C" & i) <> ""
If Range("C" & i).Value = "Independent" Then
RowNumHolder = i & ":" & i & "," & RowNumHolder
End If
i = i + 1
Loop
lengthofselect = Len(RowNumHolder)
RowNumHolderNew = Mid(RowNumHolder, 1, lengthofselect - 1) 'removes last
comma
Range(RowNumHolderNew).Select