+ Reply to Thread
Results 1 to 2 of 2

Add value when recording a macro

  1. #1
    LizW
    Guest

    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. #2
    Debra Dalgleish
    Guest

    Re: Add value when recording a macro

    After you create the chart, turn on the macro recorder again
    Select the chart, and choose Chart>Chart 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1