check for blanks in specific columns

QuietRiot

Well-known Member
Joined
May 18, 2007
Messages
1,079
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
  2. MacOS
not sure why im having a hard time with this..
check for any blanks in columns A, B, D, E, F, G and J
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hi,

What do you want to do with the blanks?

This will count the number of blanks:

=CountBlank(A1:J1000)
 
Upvote 0
actually i need VBA. i just want a message box that column bla contains a blank and then exit sub
 
Upvote 0
Hi,

Try:

Code:
Sub happyPanda()
    lRow = Range("A" & Rows.Count).End(xlUp).Row
    For i = 2 To lRow
        For j = 1 To 10
            If Cells(i, j).Value = "" Then MsgBox "Cell " & Cells(i, j).Address(RowAbsolute:=False, ColumnAbsolute:=False) & " contains a blank! *sadpanda*"
        Next j
    Next i
End Sub
Or for column number:

Code:
Sub happyPanda()
    lRow = Range("A" & Rows.Count).End(xlUp).Row
    For i = 2 To lRow
        For j = 1 To 10
            If Cells(i, j).Value = "" Then MsgBox "Column " & Cells(i, j).Column & " contains a blank! *sadpanda*"
        Next j
    Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,334
Members
452,907
Latest member
Roland Deschain

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