Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why doesn't Selection.End(xlDown).Select always work?
If you can select the cell and manually do End then hit the down arrow key
and it works, it should work with code. This will stop at the last contiguous cell that is not empty. It sounds like some of the cells maybe non-empty, but look empty. If that is the case, you may have to loop - however, you might be able to reduce the amout of looping with Dim rng as Range set rng = cells(rows.count,1).End(xlup) do while rng.Text = "" set rng = rng.offset(-1,0) Loop rng.Select -- Regards, Tom Ogilvy "Andy" wrote in message ... Hi, I am trying to get the next free row using Selection.End(xlDown).Select Sometimes it seems to work, sometimes not. Is there something else I need to know about this? I've currently given up and am using a do look looking for the next emply cell, but its a bit of a fudge, and won't win any 'pretty code' contests! Any help would be appreciated. Many thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Why doesn't Selection.End(xlDown).Select always work? | Excel Programming | |||
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. | Excel Programming | |||
Select the next row after xldown range | Excel Programming | |||
Selection.End(xlDown) with Rows selected | Excel Programming | |||
Selection.End(xlDown) with Rows selected | Excel Programming |