+ Reply to Thread
Results 1 to 9 of 9

Macros to create chart

  1. #1
    Registered User
    Join Date
    12-23-2008
    Location
    India
    Posts
    6

    Macros to create chart

    Hi,
    I would like to create chart fetching the data from excel sheet.As I am totally new to Macros....I am not sure to how to start with butI am sure that i will make this work easy.Could anyone pls let me know on the same.

    I want to selct the data range :
    AQ2 to AR2
    and AQ35 to AR45
    similarly i want it do for 10 charts.
    Whether the below one is correct?
    ******************

    Sub Macro2()
    Range("AQ32:AQ45").Select
    Range("AS32:AS35").Select
    End Sub

  2. #2
    Registered User
    Join Date
    12-23-2008
    Location
    India
    Posts
    6
    but i have not mentioned the create chart syntax ....

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437
    Please use code tags when posting code.

    It would help if you included an example workbook and an example of the type of chart you are trying to create.
    Also tell us which version of excel you are using.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Registered User
    Join Date
    12-23-2008
    Location
    India
    Posts
    6

    Re

    Hi,
    I am using ms excel version 2007.
    and the data contents are pasted below...
    I want to create 7 chart wherein with the 3 fields 1,2, 3 in the same graph.
    It should be like the area graph...as i coudnot upload the excelsheet and graph..i coudn't do that...
    sorry for the inconveience caused.........





    All fields 1
    Month D E F G H I J
    Jun-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Jul-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Aug-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Sep-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Oct-07 0.00 1.84 1.16 0.00 8.68 1.75 6.59
    Nov-07 0.00 1.84 1.12 0.00 8.62 1.66 6.02
    Dec-07 0.00 1.73 1.06 0.00 8.28 1.55 5.35
    Jan-08 0.00 1.60 1.00 0.00 8.16 1.50 5.05
    Feb-08 0.00 1.47 0.98 0.00 8.14 1.53 4.61
    Mar-08 0.00 1.48 0.98 0.00 7.99 1.47 4.37
    Apr-08 0.00 1.45 0.94 0.00 7.81 1.50 4.10
    May-08 0.00 1.47 0.96 0.00 7.24 1.41 4.00
    Jun-08 0.00 1.36 0.90 0.00 6.93 1.35 3.69
    Jul-08 0.00 1.38 0.90 0.00 6.71 1.26 3.21
    Aug-08 0.00 1.27 0.80 0.00 6.37 1.19 2.59
    Sep-08 0.00 1.31 0.77 0.00 6.25 1.14 2.18
    Oct-08 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Nov-08 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Dec-08 0.00 0.00 0.00 0.00 0.00 0.00 0.00



    All fields 2
    Month D E F G H I J
    Jun-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Jul-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Aug-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Sep-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Oct-07 0.00 1.25 0.72 0.00 7.81 0.95 3.30
    Nov-07 0.00 1.21 0.69 0.00 7.76 0.81 3.19
    Dec-07 0.00 1.12 0.65 0.00 7.45 0.76 3.10
    Jan-08 0.00 1.04 0.62 0.00 7.34 0.75 2.98
    Feb-08 0.00 1.00 0.64 0.00 7.33 0.81 2.72
    Mar-08 0.00 1.07 0.68 0.00 7.19 0.82 2.62
    Apr-08 0.00 1.03 0.65 0.00 7.03 0.84 2.50
    May-08 0.00 1.01 0.64 0.00 6.52 0.79 2.52
    Jun-08 0.00 0.92 0.59 0.00 6.24 0.77 2.25
    Jul-08 0.00 0.91 0.58 0.00 6.04 0.73 2.05
    Aug-08 0.00 0.80 0.49 0.00 5.73 0.69 1.63
    Sep-08 0.00 0.80 0.45 0.00 5.63 0.64 1.42
    Oct-08 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Nov-08 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Dec-08 0.00 0.00 0.00 0.00 0.00 0.00 0.00

    All fields 3
    Month D E F G H I J
    Jun-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Jul-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Aug-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Sep-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Oct-07 0.00 0.59 0.44 0.00 0.87 0.81 3.30
    Nov-07 0.00 0.63 0.43 0.00 0.86 0.85 2.83
    Dec-07 0.00 0.61 0.41 0.00 0.83 0.79 2.25
    Jan-08 0.00 0.56 0.38 0.00 0.82 0.75 2.07
    Feb-08 0.00 0.47 0.34 0.00 0.81 0.72 1.89
    Mar-08 0.00 0.41 0.30 0.00 0.80 0.65 1.75
    Apr-08 0.00 0.42 0.29 0.00 0.78 0.66 1.60
    May-08 0.00 0.46 0.32 0.00 0.72 0.62 1.48
    Jun-08 0.00 0.44 0.32 0.00 0.69 0.58 1.44
    Jul-08 0.00 0.47 0.32 0.00 0.67 0.53 1.16
    Aug-08 0.00 0.47 0.31 0.00 0.64 0.50 0.96
    Sep-08 0.00 0.51 0.32 0.00 0.63 0.50 0.76
    Oct-08 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Nov-08 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Dec-08 0.00 0.00 0.00 0.00 0.00 0.00 0.00

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437
    I can not tell from the pasted code how that relates to your rows/columns.

    Why can you not post that data in a workbook?

  6. #6
    Registered User
    Join Date
    12-23-2008
    Location
    India
    Posts
    6
    Hi,
    How should I post the entire work book...here....I am not able to paste my work book here......

    Thanks,
    Sowmya

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437
    We don't need your entire workbook just the example data set.

  8. #8
    Registered User
    Join Date
    12-23-2008
    Location
    India
    Posts
    6
    Thanks for your immediate response Andy.

    FIELD 1
    Month D E F G H I J
    Jun-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Jul-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Aug-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Sep-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Oct-07 0.00 1.84 1.16 0.00 8.68 1.75 6.59
    Nov-07 0.00 1.84 1.12 0.00 8.62 1.66 6.02
    Dec-07 0.00 1.73 1.06 0.00 8.28 1.55 5.35
    Jan-08 0.00 1.60 1.00 0.00 8.16 1.50 5.05
    Feb-08 0.00 1.47 0.98 0.00 8.14 1.53 4.61
    Mar-08 0.00 1.48 0.98 0.00 7.99 1.47 4.37
    Apr-08 0.00 1.45 0.94 0.00 7.81 1.50 4.10
    May-08 0.00 1.47 0.96 0.00 7.24 1.41 4.00
    Jun-08 0.00 1.36 0.90 0.00 6.93 1.35 3.69
    Jul-08 0.00 1.38 0.90 0.00 6.71 1.26 3.21
    Aug-08 0.00 1.27 0.80 0.00 6.37 1.19 2.59
    Sep-08 0.00 1.31 0.77 0.00 6.25 1.14 2.18
    Oct-08 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Nov-08 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Dec-08 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    FIELD 2
    Month D E F G H I J
    Jun-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Jul-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Aug-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Sep-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Oct-07 0.00 1.25 0.72 0.00 7.81 0.95 3.30
    Nov-07 0.00 1.21 0.69 0.00 7.76 0.81 3.19
    Dec-07 0.00 1.12 0.65 0.00 7.45 0.76 3.10
    Jan-08 0.00 1.04 0.62 0.00 7.34 0.75 2.98
    Feb-08 0.00 1.00 0.64 0.00 7.33 0.81 2.72
    Mar-08 0.00 1.07 0.68 0.00 7.19 0.82 2.62
    Apr-08 0.00 1.03 0.65 0.00 7.03 0.84 2.50
    May-08 0.00 1.01 0.64 0.00 6.52 0.79 2.52
    Jun-08 0.00 0.92 0.59 0.00 6.24 0.77 2.25
    Jul-08 0.00 0.91 0.58 0.00 6.04 0.73 2.05
    Aug-08 0.00 0.80 0.49 0.00 5.73 0.69 1.63
    Sep-08 0.00 0.80 0.45 0.00 5.63 0.64 1.42
    Oct-08 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Nov-08 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Dec-08 0.00 0.00 0.00 0.00 0.00 0.00 0.00


    FIELD 3

    Month D E F G H I J
    Jun-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Jul-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Aug-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Sep-07 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Oct-07 0.00 0.59 0.44 0.00 0.87 0.81 3.30
    Nov-07 0.00 0.63 0.43 0.00 0.86 0.85 2.83
    Dec-07 0.00 0.61 0.41 0.00 0.83 0.79 2.25
    Jan-08 0.00 0.56 0.38 0.00 0.82 0.75 2.07
    Feb-08 0.00 0.47 0.34 0.00 0.81 0.72 1.89
    Mar-08 0.00 0.41 0.30 0.00 0.80 0.65 1.75
    Apr-08 0.00 0.42 0.29 0.00 0.78 0.66 1.60
    May-08 0.00 0.46 0.32 0.00 0.72 0.62 1.48
    Jun-08 0.00 0.44 0.32 0.00 0.69 0.58 1.44
    Jul-08 0.00 0.47 0.32 0.00 0.67 0.53 1.16
    Aug-08 0.00 0.47 0.31 0.00 0.64 0.50 0.96
    Sep-08 0.00 0.51 0.32 0.00 0.63 0.50 0.76
    Oct-08 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Nov-08 0.00 0.00 0.00 0.00 0.00 0.00 0.00
    Dec-08 0.00 0.00 0.00 0.00 0.00 0.00 0.00

    I need the chart ranging from Aug08 to Dec08 as x axis
    and Y-axis 0 to 10 in numbers.I need 7 seperate charts for each D,E, F respectively.
    In each chart, I need the above mentioned range of values for the Field1 ,2 and3.
    Hope this is clear.
    please Let me know incase of any info needed.
    Thanks

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437
    Life's too short, I give up

    maybe somebody else can piece together your data and resolve your problem.

+ 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