View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default code fails if graph is selected

Try this -

If Not ActiveChart Is Nothing Then
If TypeName(ActiveChart.Parent) < "ChartObject" Then
Windows(2).Activate
End If
End If

Columns("B:B").Select

Tut tut though, shouldn't be select'ing anyway <g

Regards,
Peter T


"Scott" wrote in message
...
This code fails if a graph on the same sheet is selected (clicking inside

the
graph)

Columns("B:B").Select

If I unselect the graph (clicking ouside the graph) then code runs fine.

What can I put in the code to make sure the graphs are not selected?