ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Range(Selection...question (https://www.excelbanter.com/excel-programming/337763-range-selection-question.html)

JimDandy[_2_]

Range(Selection...question
 

This may not actually be a macro question but the solution will affect
the work I need to do in a marco.

I have a worksheet of addresses where selection keystrokes
(Ctrl+Shift+Right Arrow) as well as macro code such as
"Range(Selection, Selection.End(xlToRight)).Select" work on the header
row but these selection techniques don't work on the actual address
rows.

The way I use either method is I place the cursor on data in the first
row and either use C+S+R or execute a macro using a keyboard shortcut
assigned to that marco. Either way, the only data that gets selected is
the next row to the right, not the entire row of data. Both methods work
fine in the header row only.


--
JimDandy
------------------------------------------------------------------------
JimDandy's Profile: http://www.excelforum.com/member.php...o&userid=16578
View this thread: http://www.excelforum.com/showthread...hreadid=397279


Tom Ogilvy

Range(Selection...question
 
that action selects to but not including the next empty cell if the first
cell to the right and the active cell are not empty.

range(cells(1,Activecell.Column),cells(1,ActiveCel l.column).End(xltoRight)).
Offset(ActiveCell.row-1,0).Select

might do what you want.
--
Regards,
Tom Ogilvy

"JimDandy" wrote in
message ...

This may not actually be a macro question but the solution will affect
the work I need to do in a marco.

I have a worksheet of addresses where selection keystrokes
(Ctrl+Shift+Right Arrow) as well as macro code such as
"Range(Selection, Selection.End(xlToRight)).Select" work on the header
row but these selection techniques don't work on the actual address
rows.

The way I use either method is I place the cursor on data in the first
row and either use C+S+R or execute a macro using a keyboard shortcut
assigned to that marco. Either way, the only data that gets selected is
the next row to the right, not the entire row of data. Both methods work
fine in the header row only.


--
JimDandy
------------------------------------------------------------------------
JimDandy's Profile:

http://www.excelforum.com/member.php...o&userid=16578
View this thread: http://www.excelforum.com/showthread...hreadid=397279




JimDandy[_3_]

Range(Selection...question
 

Thanks! That was it, I really appreciate your help.


--
JimDandy
------------------------------------------------------------------------
JimDandy's Profile: http://www.excelforum.com/member.php...o&userid=16578
View this thread: http://www.excelforum.com/showthread...hreadid=397279



All times are GMT +1. The time now is 07:51 AM.

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