LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Chart Macro


When I record a chart macro and then run it, it gives an error message
on th eline Charts.Add, when the workbook is locked. How can i get
around this without manually unprotecting the workbook. Also when run
it produces a new sheet called Chart1. I do not want to create a new
sheet with the chart, but rather have it appear on the screen where the
data tables are.

Finally is there a way for me to create a user form, which has 3
different options for different charts, taken from different data, and
when each is selected the corresponding chart is diplayed on the user
form, or in the window.


This is the code for one chart so far, this generates the error
mentioned above:

Sub Chart2()
'
Range("A5:C12").Select
Charts.Add
ActiveChart.ChartType = xl3DBarClustered
ActiveChart.SetSourceData Source:=Sheets("BRANCH TOTAL CURRENT v
PREVIOUS"). _
Range("A5:C12"), PlotBy:=xlColumns
ActiveChart.Location Whe=xlLocationAsNewSheet
With ActiveChart
..HasTitle = True
..ChartTitle.Characters.Text = _
"Total Branch Scores-Current vs Previous (In-Branch)"
..Axes(xlCategory).HasTitle = True
..Axes(xlCategory).AxisTitle.Characters.Text = "Branch"
..Axes(xlSeries).HasTitle = False
..Axes(xlValue).HasTitle = True
..Axes(xlValue).AxisTitle.Characters.Text = "Indexed Scores"
End With
End Sub

Any help would be appreciated


--
kwedde01
------------------------------------------------------------------------
kwedde01's Profile: http://www.excelforum.com/member.php...o&userid=24156
View this thread: http://www.excelforum.com/showthread...hreadid=378714

 
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
Macro to change position of chart labels on line chart Shane Henderson[_2_] Charts and Charting in Excel 1 May 27th 11 09:31 AM
Chart macro sonicscooter Charts and Charting in Excel 4 April 19th 09 05:32 PM
chart macro mohavv Excel Discussion (Misc queries) 6 June 5th 08 02:31 AM
Chart Macro zephyr Charts and Charting in Excel 1 December 5th 07 04:37 PM
Chart Macro James Charts and Charting in Excel 2 March 4th 05 04:29 PM


All times are GMT +1. The time now is 11:28 AM.

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

About Us

"It's about Microsoft Excel"