Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
LizW
 
Posts: n/a
Default Add value when recording a macro

Hello,

I recorded a macro to create a bar chart - I checked the checkbox to add the
values. Stopped recording and showed me the chart with the values. If I run
the macro again, it does not display the value. What is the code I need to
always display the value?
--
LizW
  #2   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

After you create the chart, turn on the macro recorder again
Select the chart, and choose ChartChart Options
On the Data Labels tab, check Values
Click OK
Turn off the macro recorder

In the recorded code, you'll see a line similar to this:

ActiveChart.ApplyDataLabels AutoText:=True, LegendKey:=False, _
HasLeaderLines:=False, ShowSeriesName:=False, _
ShowCategoryName:=False, _
ShowValue:=True, ShowPercentage:=False, ShowBubbleSize:=False


Copy that line and paste it in your original macro code, after the lines
of code that create the chart.

LizW wrote:
Hello,

I recorded a macro to create a bar chart - I checked the checkbox to add the
values. Stopped recording and showed me the chart with the values. If I run
the macro again, it does not display the value. What is the code I need to
always display the value?



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

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
How do I turn the Macro Stop Recording Toolbar on and off? BamaBarks Excel Discussion (Misc queries) 5 November 27th 09 03:22 PM
Recording new excel macro, relative reference button doesn't show Dano New Users to Excel 3 August 23rd 05 07:36 PM
Recording simple macro Dave Excel Worksheet Functions 5 July 16th 05 12:34 AM
Macro doesn't work but recording it does. Rob Excel Discussion (Misc queries) 2 May 24th 05 06:43 AM
Recording a macro ... Marss Excel Discussion (Misc queries) 3 February 17th 05 07:26 PM


All times are GMT +1. The time now is 07:44 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"