verify a 2 dimensional range is empty?

hilyete

Active Member
Joined
Aug 19, 2009
Messages
293
I know I can use "if Not IsEmpty" on a cell, but how can I check a range like ("A2: G10") to see if all the cells are empty in an "if then" statement? I want the sub to exit if there is already information anywhere within the specified range. Tom



I wish they'd told me the "learning curve" was 360 degrees!!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Code:
If WorksheetFunction.COUNTA(Range("A2:G10")) = 0 Then
   'nothing in the range: Proceed
   'More code here
Else
   'something there: Get out
   Exit Sub
End If

I wish they'd told me the "learning curve" was 360 degrees!!
So which bit are you on; vertical or upside down?

Denis
 
Upvote 0
Thanks "Sydney"... I'm not sure what bit I'm on... I always feel like I'm upside down. :)
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,317
Members
449,081
Latest member
tanurai

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