Solved Find blank cells in a column of cells

August 23, 2013 at 11:12:05
Specs: Windows 7
Hi there,
I have a column of cells , lets say G5:G20
I require to determine which cells are blank
If for example cell G9 is blank, I then need to clear the contents of C9:E9

Any ideas


With Sheets.Range("G5:G20")
Set d = .Find(next blank cell)
If d Is Nothing Then

Rownumb = d.Row

I think I have found what I am looking for but do not know the wording/text to find the next blank cell

With the rest of the question I think I have the answer, so your help would be much appreciated

message edited by tonygibb


See More: Find blank cells in a column of cells

Report •


#1
August 23, 2013 at 20:55:52
See the .FindNext example at this page.

The code snippet used to be included in the VBA Help files, but for some reason they removed it.

http://msdn.microsoft.com/en-us/lib...

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#2
August 29, 2013 at 05:12:45
✔ Best Answer
I wholey agree with the method you are attempting to use and the link that DerbyDad has sent, however i always do thing a little differently, its just the way i have always done it, and DerbyDad is way more experienced and knowledgable than i am in VBA so do look into what he says, but here is an alternative.

Dim URange, LRange
Dim BCell As Range

Sub FindEmpty()
    
    Set URange = Range("G1")
    Set LRange = Range("G" & Rows.Count).End(xlUp)
    
    For Each BCell In Range(URange, LRange)
        
        If BCell.Value = Empty Then
            
            Range("C" & BCell.Row, "E" & BCell.Row).Clear
        End If
    Next BCell
    
End Sub


Report •
Related Solutions


Ask Question