Hi all,
I have an unknown range of data to select. I came up with this code to do it.
Sub doCount3()
Dim rng As Range
Dim num As Integer
num = 0
Range("E3").Select
Do While ActiveCell.Value <> ""
ActiveCell.Offset(0, 1).Select
num = num + 1
Loop
Range("E3:E15").Select
On Error Resume Next
Set rng = Range("E3:E15").Resize(, num).Select
On Error GoTo 0
End Sub
I was wondering if this part of it is okay:
On Error Resume Next
Set rng = Range("E3:E15").Resize(, num).Select
On Error GoTo 0
Doing this selects the unknown range and readies it for copy but if I do not use On Error, haha, I receive an error message. Is this acceptable by you gurus or is there another way I can do this?
Bookmarks