PDA

View Full Version : Check if cells is empty



av8tordude
09-05-2011, 11:02 AM
how can I check if rows B10 - B20 are filled?

av8tordude
09-05-2011, 11:24 AM
I found it...

Sub mac()
If Application.CountBlank(Range("B11:B15")) Then
MsgBox "Continue"
Else
MsgBox "Stop"
End If
End Sub

Rayman
09-05-2011, 05:17 PM
Try this:
Sub Filled()
Dim Rng As Range
Dim MyVal
Set MyVal = ActiveSheet.Cells(10, 2)
Set Rng = ActiveSheet.Range("B10:B20")
For Each MyVal In Rng
If MyVal = "" Then
MsgBox "cells" & " " & MyVal.Row & " " & "is empty"
End If
Next
End Sub


Regards

mancubus
09-06-2011, 05:00 AM
http://www.dailydoseofexcel.com/archives/2006/04/11/testing-for-empty-cells-ii/

http://www.dailydoseofexcel.com/archives/2004/08/12/testing-for-empty-cells/

av8tordude
09-06-2011, 06:28 AM
Thank you all for your help. Mancubus, thank you very much for the links as it helps me tremendously in my understanding. :friends:

mancubus
09-06-2011, 10:05 AM
Thank you all for your help. Mancubus, thank you very much for the links as it helps me tremendously in my understanding. :friends:

my pleasure.

:friends: