Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Donna S
 
Posts: n/a
Default select a cell and the one next to it

I'm trying to select the cell below the one I'm in and the cell to the right
of the one below where I am. I know how to select a cell below the cell I'm
in by useing the ActiveCell.Offset(1,0).select but I don't know how to select
the one to the right of it at the same time. Please help.


  #3   Report Post  
Gary''s Student
 
Posts: n/a
Default select a cell and the one next to it

Sub Macro()
i = Selection.Row
j = Selection.Column
Range(Cells(i + 1, j), Cells(i + 1, j + 1)).Select
End Sub

--
Gary's Student


"Donna S" wrote:

I'm trying to select the cell below the one I'm in and the cell to the right
of the one below where I am. I know how to select a cell below the cell I'm
in by useing the ActiveCell.Offset(1,0).select but I don't know how to select
the one to the right of it at the same time. Please help.


  #4   Report Post  
Earl Kiosterud
 
Posts: n/a
Default select a cell and the one next to it

Donna,

Seems to me there's a cleaner way, but this seems to work:

Cell1 = ActiveCell.Offset(1, 0).Address
Cell2 = ActiveCell.Offset(0, 1).Address
Range(Cell1 & "," & Cell2).Select

Or you can combine them, though it is harder to debug:
Range(ActiveCell.Offset(1, 0).Address & "," & ActiveCell.Offset(0,
1).Address).Select

Earl Kiosterud
www.smokeylake.com

"Donna S" wrote in message
...
I'm trying to select the cell below the one I'm in and the cell to the
right
of the one below where I am. I know how to select a cell below the cell
I'm
in by useing the ActiveCell.Offset(1,0).select but I don't know how to
select
the one to the right of it at the same time. Please help.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"