ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Selecting cells on active row (https://www.excelbanter.com/excel-discussion-misc-queries/231963-selecting-cells-active-row.html)

merry_fay

Selecting cells on active row
 
Hi,

Having used a macro to get the first cell on the row I need selected, how do
I then get it to select the range A:H or even the entire row? I can't do
xlright as there may be blanks in some columns.

Also, is there a way of getting the macro to select a cell with a specific
word in it? I've managed a work-around but it would be nicer to use more
specific, neat code

Thanks
merry_fay

Gary''s Student

Selecting cells on active row
 
Sub GetBlock()
Dim L As Long
L = ActiveCell.Row
Range("A" & L & ":H" & L).Select
End Sub

This will Select A thru H in the row with the ActiveCell.
--
Gary''s Student - gsnu200855


"merry_fay" wrote:

Hi,

Having used a macro to get the first cell on the row I need selected, how do
I then get it to select the range A:H or even the entire row? I can't do
xlright as there may be blanks in some columns.

Also, is there a way of getting the macro to select a cell with a specific
word in it? I've managed a work-around but it would be nicer to use more
specific, neat code

Thanks
merry_fay



All times are GMT +1. The time now is 02:20 PM.

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