Results 1 to 1 of 1
2004-09-08, 08:52 #1
- Join Date
- Feb 2004
- Cape Town, RSA
- Thanked 1 Time in 1 Post
Checking the selection! (Excel VBA 2000>)
When running a macro to work with a range is triggered while a chart on the worksheet is active, your macro will fail.
Use the following code to check for a range selection to prevent this error from occurring.
You can use VBA's TypeName function to check the Selection.
Here's an example:
<pre>If TypeName(Selection) <> "Range" Then
MsgBox "Please select a range of cells!"