Results 1 to 3 of 3
  1. #1
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: VBA for Excel (Excel 2000)

    To list them in a new worksheet in the active workbook:

    Sub Chartlist()
    Dim wks As Worksheet
    Dim lngS As Long, lngC As Long, lngX As Long

    Set wks = ActiveWorkbook.Worksheets.Add
    For lngS = 1 To ActiveWorkbook.Sheets.Count
    With ActiveWorkbook.Sheets(lngS)
    For lngC = 1 To .ChartObjects.Count
    lngX = lngX + 1
    wks.Cells(lngX, 1).Value = .Name & "; " & .ChartObjects(lngC).Name
    Next lngC
    End With
    Next lngS
    wks.Columns(1).WrapText = False
    wks.Columns(1).EntireColumn.AutoFit
    Set wks = Nothing
    End Sub
    -John ... I float in liquid gardens
    UTC -7ąDS

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: VBA for Excel (Excel 2000)

    I don't work much with charts or charts in VBA, but see if this gets you started:

    Sub Chartlist()
    Dim lngC As Long, lngS As Long
    Dim strL As String

    For lngS = 1 To ActiveWorkbook.Sheets.Count
    With ActiveWorkbook.Sheets(lngS)
    For lngC = 1 To .ChartObjects.Count
    strL = strL & .Name & "; " & .ChartObjects(lngC).Name & vbLf
    Next lngC
    End With
    Next lngS
    MsgBox strL
    End Sub
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    Lounger
    Join Date
    Dec 2004
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro to list chart objects (Excel 2000)

    Subject edited by HansV to aid in future searches

    Is there VBA code that can give me a list of chart objects represented in a tab? I have several excel tabs that have numerous charts on them. Over time, they have accumulated and the names are "chart 1, chart 6, etc...". I am writing VBA print code to print groups of the charts with a button, but I would like a list of all the chart as they are named to reference, especially if I add more later and wonder which ones I already had.

Posting Permissions

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