+ Reply to Thread
Results 1 to 4 of 4

Macro for Automatic Excel Charts

Hybrid View

Gouthama Macro for Automatic Excel... 03-18-2008, 02:15 AM
Mark@Work The best way to get started... 03-18-2008, 01:38 PM
Gouthama Hi Mark , Can u pls send... 03-19-2008, 12:25 AM
gshock You already know all that you... 03-25-2008, 10:05 AM
  1. #1
    Registered User
    Join Date
    03-18-2008
    Posts
    2

    Macro for Automatic Excel Charts

    Hi All,

    I want to create one macro , which takes the values from the excel columns
    and need to display one Chart dynamically . That is either Bar or pi Charts
    with the values which will be printed in the Columns .
    The chart need to be displayed in Chart1 Page of same Excel sheet . Is there any way to fire the Macro automatically to generate the Chart ?

    Iam new to excel Programming but Iwant this functionality through my Java.
    So I want to create one Macro for this.

    Thanks in Advance

  2. #2
    Forum Contributor
    Join Date
    10-27-2006
    Location
    United Kingdom
    MS-Off Ver
    EXCEL 2003 (2007 at home)
    Posts
    517
    The best way to get started with VBA macros is to use the "record" feature.
    (on the tool bar : Tools>Macro>Record New Macro...)
    This will then follow your actions as you produce the chart, and create a program that mimics your actions.
    Note that it will also mimic any mistakes you make...

    When you have finished the recording, press Alt F11 (or Tools>Macro>Visual Basic Editor)
    You can now try to match what you did against what you see in the program.
    The help facilities are quite good. Press F1 at any time to get help on the object you are currently editing.

    Good luck

    Mark.

  3. #3
    Registered User
    Join Date
    03-18-2008
    Posts
    2
    Hi Mark ,

    Can u pls send me the Sample code which suits for my question bcz
    I dont know how to write the Macro ? and the rules ?


    Thanks for the reply

  4. #4
    Forum Contributor
    Join Date
    03-04-2008
    Location
    Ohio
    MS-Off Ver
    Office 2010
    Posts
    208

    You already know all that you need.

    Quote Originally Posted by Gouthama
    Hi Mark ,

    Can u pls send me the Sample code which suits for my question bcz
    I dont know how to write the Macro ? and the rules ?


    Thanks for the reply
    Gouthama,
    Per Mark's instructions, go to Tools -> Macro -> Record Macro. This simply records your actions. Use what you already know about creating graphs and make the Pie or Bar chart as your need requires. What Mark is telling you is that once you're finished, you complete the macro by pressing the "Stop" button. This button appears as soon as you start recording the macro. Then, by pressing Alt + F11, you can see what the code is for those steps. This answers your question AND teaches you what you want to know at the same time.


    -gshock

+ 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