Selecting next blank cell

Yellowdude

New Member
Joined
Mar 4, 2002
Messages
20
Ive got a table and i want excel to automatically go through all the table untill it finds a blank cell and then add an x to the empty cell. Is there a formula that can do this or a macro?
 
To MarkW

Here's some shorter code (no loop required) :-

Dim cell As Range
Set cell = [A1:J10].Find("", After:=[J10], SearchOrder:=xlByColumns)
cell.Value = "X"
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
On 2002-03-06 17:28, Autolycus wrote:
To MarkW

Here's some shorter code (no loop required) :-

Dim cell As Range
Set cell = [A1:J10].Find("", After:=[J10], SearchOrder:=xlByColumns)
cell.Value = "X"


Or just in one line of code :-

[A1:J10].Find("", After:=[J10], SearchOrder:=xlByColumns).Value = "X"
 
Upvote 0
Wow, I just got home after being out all day to see these great code suggestions. I really learned something from this thread. Thanks everyone.

Tom Urtis
 
Upvote 0
On 2002-03-06 17:28, Autolycus wrote:
To MarkW

Here's some shorter code (no loop required) :-

Dim cell As Range
Set cell = [A1:J10].Find("", After:=[J10], SearchOrder:=xlByColumns)
cell.Value = "X"

Wicked! :biggrin: Thank you for your contribution.
 
Upvote 0

Forum statistics

Threads
1,215,020
Messages
6,122,712
Members
449,093
Latest member
Mnur

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