How do I select certain cells within a row?

C

coolwik

Hello,

I have this command that selects the current row:

ActiveCell.EntireRow.Select

....but I just want to select the first 4 cells in the row, for
instance:

Range("A1:D1").Select

.... now say I'm using the command within a loop, so I can't reference
a specific Range. How can I tell the macro to just select the first 4
cells in the current row?

Thanks for any help!
 
C

Chip Pearson

Try something like

ActiveSheet.Cells(ActiveCell.Row, 1).Resize(1, 4).Select

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting LLC
www.cpearson.com
(email on the web site)
 
L

Linda.Marcellus

Hello,

I have this command that selects the current row:

ActiveCell.EntireRow.Select

...but I just want to select the first 4 cells in the row, for
instance:

Range("A1:D1").Select

... now say I'm using the command within a loop, so I can't reference
a specific Range. How can I tell the macro to just select the first 4
cells in the current row?

Thanks for any help!

This should work:

With ActiveCell.EntireRow
.Range(.Cells(1, 1), .Cells(1, 4)).Select
End With
 
Top