Select Cells

brettvba

MrExcel MVP
Joined
Feb 18, 2002
Messages
1,030
Need Some code to select the next empty cell on a page for example
range("a1").select
'where a2 is the next avaliable cell
then a3 and so on?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
On 2002-03-13 16:54, brettvba wrote:
Need Some code to select the next empty cell on a page for example
range("a1").select
'where a2 is the next avaliable cell
then a3 and so on?

There are better methods but this old dog is only just learning:

Dim MTCell as Range
for each MTcell in Range("a1:A10")
If ActiveCell = Not Empty Then
(do your thing here)
End If
Next
 
Upvote 0
On 2002-03-13 16:54, brettvba wrote:
Need Some code to select the next empty cell on a page for example
range("a1").select
'where a2 is the next avaliable cell
then a3 and so on?


Dim cell As Range, rng As Range
Set rng = Columns(1).SpecialCells(xlCellTypeBlanks)
For Each cell In rng
MsgBox cell.Address
Next
 
Upvote 0
On 2002-03-14 00:40, Anonymous wrote:
On 2002-03-13 16:54, brettvba wrote:
Need Some code to select the next empty cell on a page for example
range("a1").select
'where a2 is the next avaliable cell
then a3 and so on?

Or perhaps you are just looking for :-

[A65536].End(xlUp)(2,1).Select


Dim cell As Range, rng As Range
Set rng = Columns(1).SpecialCells(xlCellTypeBlanks)
For Each cell In rng
MsgBox cell.Address
Next
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,557
Latest member
richa mishra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top