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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
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,224,271
Messages
6,177,618
Members
452,786
Latest member
k3calloway

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