Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Formatting charts, problem with deselection.

Hello all,

I wrote a Sub to format all charts equally once selected and running
the procedu


Sub ChartMods()

If ActiveChart Is Nothing Then
MsgBox "No chart selected"
Exit Sub
End If
With ActiveChart
.ChartArea.Font.Name = "Arial"
.ChartArea.Font.FontStyle = "Regular"
.ChartArea.Font.Size = 16
End With

End Sub

Then I made the following call:

Private Sub CommandButton1_Click()
Call ChartMods

End Sub

But the problem is: when I select the chart and then click the button,
the chart gets deselected and the button becomes active in stead of
the chart. What Am I Overlooking?

thanks in advance.

Fries
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Formatting charts, problem with deselection.

Set the changefocusonclick property of the command button to false.

--
Regards,
Tom Ogilvy

"Fries" wrote in message
om...
Hello all,

I wrote a Sub to format all charts equally once selected and running
the procedu


Sub ChartMods()

If ActiveChart Is Nothing Then
MsgBox "No chart selected"
Exit Sub
End If
With ActiveChart
.ChartArea.Font.Name = "Arial"
.ChartArea.Font.FontStyle = "Regular"
.ChartArea.Font.Size = 16
End With

End Sub

Then I made the following call:

Private Sub CommandButton1_Click()
Call ChartMods

End Sub

But the problem is: when I select the chart and then click the button,
the chart gets deselected and the button becomes active in stead of
the chart. What Am I Overlooking?

thanks in advance.

Fries



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Weard problem with formatting of charts in Excel 2007 Rolando Excel Discussion (Misc queries) 7 May 17th 09 10:08 AM
Group page selection and deselection Gene Augustin Excel Discussion (Misc queries) 2 February 5th 09 02:58 PM
excel 2000 shortcut for deselection leef_me Excel Discussion (Misc queries) 2 May 30th 07 11:01 PM
Formatting pie charts via VBA [email protected] Charts and Charting in Excel 3 June 14th 06 10:01 AM
Formatting Charts pmguerra Excel Discussion (Misc queries) 1 August 1st 05 07:10 PM


All times are GMT +1. The time now is 10:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"