Sub select_to_lastcolumn()
'select to last filled column in activerow, ignoring intermediate blanks
Range(ActiveCell, Cells(ActiveCell.Row, Columns.Count).End(xlToLeft)).Select
End Sub
What the code does is start from far right column then work back until it
reaches the first non-blank cell.
Gord Dibben MS Excel MVP
On Thu, 7 Jul 2011 09:58:50 -0700 (PDT), avi <(E-Mail Removed)> wrote:
>Hello,
>
>I am looking for a robust code that will count no empty cells at the
>right of a selection
>
>Using Range(Selection, Selection.End(xlToRight)).Select seems to
>capture all the cells only the next block and not all the columns at
>the right
>
>Thanks
>Avi
|