Formula for first blank cell in a range

ccordner

Active Member
Joined
Apr 28, 2010
Messages
355
I am producing a roster and need to find out if a person has a day off during a week.

At the moment, I have a very complicated formula saying "if(g3="",...,if(h3="",.. etc.

Is there any formula I can use to find the first blank cell in a range (1 row x 7 columns)? Specifically, I need it to return the column number (either within the range, or absolute).

Thanks
Chris
 
I was given this to solve a similar problem with columns:

Code:
Set wksSource = Worksheets("Sheet Name")
    With wksSource
        LastRow = .Cells(.Rows.Count, "D").End(xlUp).Row
    End With

Would this be any use?
 
Upvote 0

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
I believe that code only searches a single column for the first blank, starting from the bottom. I need to search a range of cells starting from the beginning. Range would be B10:H100.
 
Upvote 0
I'm not sure to be honest. I use it to find the first blank cell in a column, so I think it starts from the top but I' don't know. I'm sure somebody on here will though!
 
Upvote 0
If it's the last Blank Cell in a range, how about something like this?

It's a bit clunky, but that searches bottom to top, right to left. To do rows first, just swap the row/column functions around.

At the end, RowNumber/ColNumber give you the last empty cell?

Code:
Sub Example()
Dim Found, RowNumber, ColNumber
Found = False
Proof = 1
Do While Found = False
    
    ColNumber = 8
    
    For a = 1 To 7
    
        RowNumber = 100
    
        For b = 1 To 90
    
            If Sheets("Sheet1").Cells(RowNumber, ColNumber) = "" Then
                Found = True
            End If
            
            RowNumber = RowNumber - 1
    
        Next
    
        ColNumber = ColNumber - 1
    
    Next
        
Loop
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,470
Members
452,915
Latest member
hannnahheileen

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