Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VBA to Check if Range is Set?

Posted on 2013-05-23
2
Medium Priority
?
501 Views
Last Modified: 2013-05-23
Hi All,

I thought this would be simple... ya, I think that a lot!
If rng = Nothing Then
Debug.Print "No-thing"
Else
Debug.Print "A-thing"
End If

Open in new window


I just want know if the range = Nothing. When I hover over the range it says rng = Nothing but I don't know how to get this information via VBA.

Thanks in advance!
0
Comment
Question by:DrTribos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 1600 total points
ID: 39190190
I thought"that looks like one of Steve's"

Dim rng As Range

If rng Is Nothing Then
Debug.Print "No-thing"
Else
Debug.Print "A-thing"
End If

Open in new window

0
 
LVL 15

Author Comment

by:DrTribos
ID: 39190198
Doh! it's an IS?  wow!
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question