Issue with Selection.End(xlDown)

[Closed]
Report
-
Posts
5
Registration date
Sunday March 29, 2009
Status
Member
Last seen
June 12, 2009
-
Hello,
I am working on a few macros and came across this problem. If I use the code below to select a range of cells and if my working rows only have one row, the command selects, in this example, C2 all the way down to the maximum ie. C9999999999. The code halts with an error when it is looping through an infinite (or very large) number of cells. I do not have problems when the data consists of more than one row. I only want to select everything in column C, starting in C2 that has data, not the blank cells below

Range("C2").Select
Range(Selection, Selection.End(xlDown)).Select
For Each Cell In Selection
command
command
command
Next Cell
Related:

1 reply

Posts
5
Registration date
Sunday March 29, 2009
Status
Member
Last seen
June 12, 2009
1
1
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2821 users have said thank you to us this month