Check Selection

C

Chris Gorham

Hi,

I want to make sure that when I write code such as
activecell.select that the macro doesn't bug out because
an object such as a chart happens to be currently selected
on the s/sheet and not a cell range.

thks...Chris
 
V

Vasant Nanavati

Tim; did you mean:

If Typename(Selection) = "Range" Then

?

Regards,

Vasant.
 
T

Tim Zych

Well, no because Typename(ActiveCell) returned "Nothing" if the activated
object was a chart.
Looks like one and the same for the purpose as stated.
 
V

Vasant Nanavati

You're right, Tim ... that's interesting. I thought it would throw an error.
I should have tested before I posted!

Regards,

Vasant.
 
Top