Results 1 to 9 of 9
  1. #1
    3 Star Lounger
    Join Date
    Jul 2005
    Location
    Bahrain
    Posts
    373
    Thanks
    1
    Thanked 0 Times in 0 Posts

    charts (excel2003)

    The question is in the attachment and you may have covered this in previous posts!
    Thanks in advance.
    TIA
    dubdub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: charts (excel2003)

    Instead of creating separate charts, you can create one chart and use AutoFilter to select a name. The chart will adjust automatically when you select a name in the Filter dropdown list in A1.

  3. #3
    3 Star Lounger
    Join Date
    Jul 2005
    Location
    Bahrain
    Posts
    373
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: charts (excel2003)

    Hans, this is fine, but is there a way to print all charts for all names in one batch submission run.
    thanks,
    dubdub
    TIA
    dubdub

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: charts (excel2003)

    In the attached workbook, I have moved the chart to a separate chart sheet using Chart | Location...

    I have used Data | Filter | Advanced Filter with the Copy option and Unique records only to create a list of unique names in cell A12 and below.
    This removed the AutoFilter, so I turned it on again.
    Next to the list of unique names is a command button from the Forms toolbar that executes the PrintCharts macro.
    This macro loops through the unique names, sets the AutoFilter and prints the chart sheet.
    Look at the code in the Visual Basic Editor.

    Note: the macro won't work if macro security is set to High.

  5. #5
    3 Star Lounger
    Join Date
    Jul 2005
    Location
    Bahrain
    Posts
    373
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: charts (excel2003)

    Many thanks HANS.
    one additional thing, can a title line added and updated to reflect the name(s).
    thanks again.
    TIA
    dubdub

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: charts (excel2003)

    Sorry, I don't understand your additional question. What should the title line contain?

  7. #7
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: charts (excel2003)

    How about modifying the section of code to add the new lines below:
    <pre>'Start of code
    'Existing line"
    wsh.Range("A1").AutoFilter Field:=1, Criteria1:=wsh.Range("A" & lngRow)
    'Next 2 lines are new:
    <font color=red>cht.HasTitle = True
    cht.ChartTitle.Characters.Text = wsh.Range("A" & lngRow)</font color=red>
    'Existing line:
    cht.PrintOut
    'rest of code</pre>


    It will add the name you are filtering on, onto the chart.
    Steve

  8. #8
    3 Star Lounger
    Join Date
    Jul 2005
    Location
    Bahrain
    Posts
    373
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: charts (excel2003)

    Hans & Steve
    Very sorry for the late reply, full appreciation to both of you.
    TIA
    dubdub

  9. #9
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: charts (excel2003)

    I should comment, the code only works when you are printing all the charts. It does not do it when you filter manually...

    Steve

Posting Permissions

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