determine if cells are empty

johannes2008

New Member
Joined
Aug 20, 2010
Messages
45
Office Version
  1. 365
Platform
  1. Windows
Hello All

I was wondering if anyone had any ideas on how to code for this:

What I need is to check if 4 cells in a row (all next to each other) are completely empty (no formulas, no numbers, no text). The row number is changing after every check white a Do/Until loop. In fact the loop will continue until it encounters a row where all 4 cells are empty

so what I am trying to use, that isn't working, is:
Loop Until ActiveCell.Offset(z, x + 1) = "" & ActiveCell.Offset(z, x + 2) = "" & ActiveCell.Offset(z, x + 3) = "" & ActiveCell.Offset(z, x + 4) = ""


any help?
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
What about this...

Code:
Loop Until WorksheetFunction.CountBlank(ActiveCell.Offset(z, x + 1).Resize(, 4)) = 4
 
Upvote 0
Hey Andrew

I tried your code and it works perfect:) THANKS!
Did it work "as posted"? I ask because your code snippet showed the 4 cells you wanted to test were next to each other along the same row, not down down a column... Andrew's Resize specifies 4 cells in a column... you would need Resize(,4) to specify 4 cells along a row (note the comma).
 
Upvote 0
Well it worked, but not right. Now with the comma it does work right.

I was wondering if you could tell me what CountA does so maybe I can use it in the future.

Thanks
-Johannes
 
Upvote 0

Forum statistics

Threads
1,224,582
Messages
6,179,670
Members
452,936
Latest member
anamikabhargaw

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