Range Contents Check

  • Thread starter Thread starter James Montgomery
  • Start date Start date
J

James Montgomery

Hi,
Prior to openning a User Form I would like to check this range ("D32:E32")
for contents. If the range has nothing in it proceed with my code to open
the user form and if the range has anything in it (text, numbers) just exit
the sub

Could some help me with this
Thanks
James
 
James Montgomery said:
Hi,
Prior to openning a User Form I would like to check this range ("D32:E32")
for contents. If the range has nothing in it proceed with my code to open
the user form and if the range has anything in it (text, numbers) just
exit
the sub

Hi James,

Here's one way to do it:

Sub MySub()
If Application.CountA(ActiveSheet.Range("D32:E32")) = 0 Then
UserForm1.Show
End If
End Sub

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 
Thank You Rob,
Worked great
James

Rob Bovey said:
Hi James,

Here's one way to do it:

Sub MySub()
If Application.CountA(ActiveSheet.Range("D32:E32")) = 0 Then
UserForm1.Show
End If
End Sub

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top