Select the end of a row plus 1

S

solomon_monkey

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
 
T

Tom Ogilvy

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
 
B

Bob Phillips

Solomon,

You might be meaning this

Set rng = Range("B3").End(xlDown)
Set rng = rng.End(xlToRight).Offset(0, 1)
 
S

solomon_monkey

Hi Tom,

I've seen your name appear on a load of the answers I found in the
groups... many thanks for this... superb info.

Cheers,

Solomon.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top