Check for blank cells in variable range

SueBK

Board Regular
Joined
Aug 12, 2014
Messages
114
I feel like I spend more time on here than actually working, but without the time on here I wouldn't be working at all. Anyhoo...

I have a set of worksheets with data broken into states. Each state is 'allowed' to add columns to the end of my dataset but they are not allowed to change my column structure in anyway (add, delete, rearrange). They are also not supposed to add new rows without me giving them an ID number for column A. Each worksheet will have a different, and variable number of rows from day-to-day.

Every morning I need to merge these worksheets into a single sheet. This is just one question that I have for the process that I've devised. (I figure breaking them down into separate posts would be easier to answer.)

As the first step of my macro I would like to check Column A for blank cells. There is always going to be data in Column B (site name), but a user may not have asked for a new record ID number. I'm thinking maybe the simplest way would be :

if sheet("1") - countif(B:B) <> countif(A:A) then
msg box "sheet 1 requires ID numbers"
and end macro
else
repeat for each sheet

Seems straight forward enough, but I'm not sure how to begin.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
I've gone with a hidden sheet that with 'countif' on my Col B and 'countif' on my Col A. If B-A>0, the macro starts with a message box to fix it and cancels out. The information has to be fixed before proceeding, so it makes more sense to just cancel out the macro immediately. The hidden sheet then tells me which sheet the issue is on.
 
Upvote 0

Forum statistics

Threads
1,223,268
Messages
6,171,100
Members
452,379
Latest member
IainTru

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