Searching for non null cells

J

Jeff

I'd like to create a scrip that searches a column for non null cells. Then
when it finds the non null cell it displays the cell name (i.e a10)
any suggestions?

Thanks,
 
P

Per Jessen

Hi

Look at this:

Sub FindNonNullCells()
Dim TargetCol As String
Dim LastRow As Long

TargetCol = "A"
LastRow = Cells(Rows.Count, TargetCol).End(xlUp).Row

For r = 1 To LastRow
If Range(TargetCol & r).Value = "" Then
msg = MsgBox("Null cell found in : " & TargetCol & r)
End If
Next
End Sub

Regards,
Per
 

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