ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   selecting data (https://www.excelbanter.com/excel-programming/275565-selecting-data.html)

Darron Ross

selecting data
 
I'm selecting some data with a macro that has some blanks
within the data. I'm using:

Range(Selection, Selection.End(xlDown)).Select

to select the cells below my current activecell. However
when I go to select cell to the right of my current
activecell using:

Range(Selection, Selection.End(xlToRight)).Select

It only selects part of the data. It stops right before a
blank cell and doesn't continue. This command is doing
what it should but I need to be able to select everything
to the right. I would be very happy if the code selected
all the way to IV. Just to insure I’m getting everything.

Thanks for your time and Help.
Darron


Ron de Bruin

selecting data
 
Range(ActiveCell, Cells(ActiveCell.row, Columns.Count).End(xlToLeft)).Select

Try this

Range(Selection, Selection.End(xlDown)).Select

this will also stop on the first blank cell?

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Darron Ross" wrote in message ...
I'm selecting some data with a macro that has some blanks
within the data. I'm using:

Range(Selection, Selection.End(xlDown)).Select

to select the cells below my current activecell. However
when I go to select cell to the right of my current
activecell using:

Range(Selection, Selection.End(xlToRight)).Select

It only selects part of the data. It stops right before a
blank cell and doesn't continue. This command is doing
what it should but I need to be able to select everything
to the right. I would be very happy if the code selected
all the way to IV. Just to insure I’m getting everything.

Thanks for your time and Help.
Darron





All times are GMT +1. The time now is 12:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com