View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Select the end of a row plus 1

Sub Test()
Dim rng As Range

Set rng = Range("B3").End(xlDown)

rng.offset(1,0).Select 'Next row
rng.offset(0,1).Select ' cell to the right
rng.offset(-1,0).select ' cell above
rng.offset(0,-1).Select 'cell to the left

rng.offset(1,1).Select 'cell down 1, to the right 1
End Sub


--
Regards,
Tom Ogilvy

"solomon_monkey" wrote in message
oups.com...
Right- first post out of the way and I'm on a roll... I am horribly
stuck on trying to select the cell immediately to the right of a row.

I used the following code to select the cell at the bottom of a column
(in this case 'B' where the data starts in row 3)

Sub Test()
Dim y As Long
Dim rng As Range

Set rng = Range("B3").End(xlDown)
y = rng.Row + 1

Range("b" & y).Select

End Sub

But I got this (applying the same [or so I thought] logic)

Sub Test()
Dim y As Long
Dim rng As Range

Set rng = Range("b3").End(xlDown)
y = rng.Row + 1

Range("b" & y).Select

End Sub

But this selects the same cell and +2 selects the cell below +3 the
cell below that etc...

I'm stuck.

Any ideas?

Thanks

Solomon