R
Risky Dave
Hi,
I am trying to pass the number of rows in a data range to an integer
variable but I don't know how many rows of data there are.
I have:
Dim iRowCount as Integer
iRowCount = Cells(2, "U").End(xlDown).Row ' get number of rows to be sorted
Range("T3:Y" & iRowCount).Select
' this will subsequently sorted
Which doesn't work (returns the error Run Time error 6 Overflow), though
the line:
Msgbox(Cells(2, "U").End(xlDown).Row)
returns the correct value in the message box.
I assume that I need to do some sort of conversion to force the value
returned by Cells(2, "U").End(xlDown).Row into an integer but don't know the
syntax.
Any help would be appreciated.
TIA
Dave
I am trying to pass the number of rows in a data range to an integer
variable but I don't know how many rows of data there are.
I have:
Dim iRowCount as Integer
iRowCount = Cells(2, "U").End(xlDown).Row ' get number of rows to be sorted
Range("T3:Y" & iRowCount).Select
' this will subsequently sorted
Which doesn't work (returns the error Run Time error 6 Overflow), though
the line:
Msgbox(Cells(2, "U").End(xlDown).Row)
returns the correct value in the message box.
I assume that I need to do some sort of conversion to force the value
returned by Cells(2, "U").End(xlDown).Row into an integer but don't know the
syntax.
Any help would be appreciated.
TIA
Dave