![]() |
Check Selection
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 |
Check Selection
If Typename(ActiveCell) = "Range" Then
ActiveCell.Select End If "Chris Gorham" wrote in message ... 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 |
Check Selection
Tim; did you mean:
If Typename(Selection) = "Range" Then ? Regards, Vasant. "Tim Zych" wrote in message ... If Typename(ActiveCell) = "Range" Then ActiveCell.Select End If "Chris Gorham" wrote in message ... 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 |
Check Selection
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. "Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message ... Tim; did you mean: If Typename(Selection) = "Range" Then ? Regards, Vasant. "Tim Zych" wrote in message ... If Typename(ActiveCell) = "Range" Then ActiveCell.Select End If "Chris Gorham" wrote in message ... 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 |
Check Selection
You're right, Tim ... that's interesting. I thought it would throw an error.
I should have tested before I posted! Regards, Vasant. "Tim Zych" wrote in message ... 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. "Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message ... Tim; did you mean: If Typename(Selection) = "Range" Then ? Regards, Vasant. "Tim Zych" wrote in message ... If Typename(ActiveCell) = "Range" Then ActiveCell.Select End If "Chris Gorham" wrote in message ... 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 |
All times are GMT +1. The time now is 07:23 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com