ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   get ActiveCell.Address when a chart is selected (https://www.excelbanter.com/excel-programming/435866-get-activecell-address-when-chart-selected.html)

Brian Murphy

get ActiveCell.Address when a chart is selected
 
Is it possible to get ActiveCell.Address while a chart on a worksheet
is selected?

Thanks,

Brian

Peter T

get ActiveCell.Address when a chart is selected
 
A couple of window properties will get it -

For Each wn In ActiveWorkbook.Windows
If Not wn.ActiveCell Is Nothing Then
Set acell = wn.ActiveCell
MsgBox acell.Address & vbCr & _
wn.RangeSelection.Address
Exit For
End If
Next

Obviously if you know an embedded chart item is selected simply
ActiveWorkbook.Windows(2).ActiveCell

But don't do that in 2007, earlier versions only

Regards,
Peter T


"Brian Murphy" wrote in message
...
Is it possible to get ActiveCell.Address while a chart on a worksheet
is selected?

Thanks,

Brian




Brian Murphy

get ActiveCell.Address when a chart is selected
 
Thank you, Peter. I will give that a try.

Brian

On Nov 5, 4:40 pm, "Peter T" <peter_t@discussions wrote:
A couple of window properties will get it -

For Each wn In ActiveWorkbook.Windows
If Not wn.ActiveCell Is Nothing Then
Set acell = wn.ActiveCell
MsgBox acell.Address & vbCr & _
wn.RangeSelection.Address
Exit For
End If
Next

Obviously if you know an embedded chart item is selected simply
ActiveWorkbook.Windows(2).ActiveCell

But don't do that in 2007, earlier versions only

Regards,
Peter T

"Brian Murphy" wrote in message

...

Is it possible to get ActiveCell.Address while a chart on a worksheet
is selected?


Thanks,


Brian




All times are GMT +1. The time now is 08:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com