+ Reply to Thread
Results 1 to 10 of 10

Edit chart seriescollection within a "With" - "End With" Block

Hybrid View

gipsyfkls14 Edit chart seriescollection... 10-24-2018, 06:36 PM
AlphaFrog Re: Edit chart... 10-24-2018, 07:08 PM
gipsyfkls14 Re: Edit chart... 10-24-2018, 08:11 PM
AlphaFrog Re: Edit chart... 10-24-2018, 08:41 PM
gipsyfkls14 Re: Edit chart... 10-24-2018, 11:55 PM
AlphaFrog Re: Edit chart... 10-25-2018, 07:10 AM
gipsyfkls14 Re: Edit chart... 10-25-2018, 07:52 AM
gipsyfkls14 Re: Edit chart... 10-25-2018, 11:14 AM
AlphaFrog Re: Edit chart... 10-27-2018, 07:28 AM
gipsyfkls14 Re: Edit chart... 10-29-2018, 09:18 PM
  1. #1
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,651

    Re: Edit chart seriescollection within a "With" - "End With" Block

    Not tested...

    Sub editseriescollection()
        With ActiveSheet.ChartObjects("Gráfico 1").Chart
            .FullSeriesCollection(2).Values = "=qry_123!C2:C" & Range("qry_123!C2").End(xlDown).Row
            .FullSeriesCollection(1).XValues = "=qry_123!E2:E" & Range("qry_123!E2").End(xlDown).Row
        End With
    End Sub
    
    Sub editformarfill()
        ActiveChart.FullSeriesCollection(1).Format.Fill.Visible = msoFalse
    End Sub
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  2. #2
    Forum Contributor
    Join Date
    04-22-2014
    Location
    Turrialba, Costa Rica
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: Edit chart seriescollection within a "With" - "End With" Block

    I really appreciate your reply.

    I wrote the first code as:
    Sub editseriescollection()
        With ActiveSheet.ChartObjects("Gráfico 1").Chart
            .FullCollection(2).Values = Range("A2", Range("A2").End(xlDown))
            .FullCollection(1).XValues = Range("E2", Range("E2").End(xlDown))
        End With
    End Sub
    VBA displays 'Error 438 Object does not support this property or method' here:
    .FullCollection(2).Values = Range("A2", Range("A2").End(xlDown))
    Sub editformarfill()
    
    With second code:
    Set ch = ActiveChart.FullSeriesCollection(1) .Format.Fill.Visible = msoFalse
    End Sub
    VBA displays 'Error 438 Object does not support this property or method' here:
    Set ch = ActiveChart.FullSeriesCollection(1) .Format.Fill.Visible = msoFalse
    I am trying to write codes inside a With End With Block.
    Moreover, I tried to declare variables such as.
    Dim ws As Excel.Worksheet, xlChart As Excel.ChartObject
    Set ws = wb.Sheets("qry_123")
    Set xlChart = ws.ChartObjects(1)
    I spent hour and hours googling and I did not find similar code examples.

    Any help is really welcome

    Cheers

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 02-05-2019, 12:03 AM
  2. Replies: 2
    Last Post: 07-24-2017, 02:19 AM
  3. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  4. Chart SeriesCollection(i).XValues "error 1004: invalid parameter"
    By aochan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-11-2016, 04:16 AM
  5. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  6. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  7. Error msgs: "Object varible or with block variable not set"; "subscript out of range"
    By menyanthe in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-26-2009, 04:58 PM

Tags for this Thread

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