hi,
i am trying to set a range in column D5. if there are 2 sets of data, then i need to set the range for the 2nd set of data in the column. The 2nd set of data is preceded by a blank cell in the column.
i have something like this which seems to work but there must be a better way.
[vba]
Sub test4()
FirstRow = range("D4").End(xlDown).Row + 2
LastRow = range("D4").End(xlDown).Row
MoreData = range("D4").End(xlDown).Offset(2, 0)
LastRow = Cells(Rows.Count, "D").End(xlUp).Row
If MoreData <> "" Then
For i = FirstRow To LastRow
Dkey = range("D" & i)
'do stuff
Next
Else
For i = 5 To LastRow
Dkey = range("D" & i)
'do stuff
Next
End If
End Sub
[/vba]
thanks
zach