I am using the following code to define a range in Excel 2007 VBA:
This works fine if there are any non-empty cells in the range from F3 to F5000. If there isn't, List will become the first non-empty cell found above cell F3. I can't figure out a way to define a range that is confined to non-empty cells between F3 and F5000. Once I've defined that range, I want to find the number of non-empty cells. Can anyone provide some insight?
Thanks,
Paul Hudgens
Code:
With ThisWorkbook.Worksheets(MainWks)
Set List = .Range("F3", .Range("F5000").End(xlUp))
End With
This works fine if there are any non-empty cells in the range from F3 to F5000. If there isn't, List will become the first non-empty cell found above cell F3. I can't figure out a way to define a range that is confined to non-empty cells between F3 and F5000. Once I've defined that range, I want to find the number of non-empty cells. Can anyone provide some insight?
Thanks,
Paul Hudgens