+ Reply to Thread
Results 1 to 2 of 2

Showing Active range for Chart

  1. #1
    Forum Contributor
    Join Date
    10-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    112

    Showing Active range for Chart

    I am trying to write a Macro to select the active cell from Z$2 and down. I don't want to write a random number at the end since each week I have more or less rows in my table.

    For example

    "='Table'!$Z$2:$Z$5969" should be like "='Table'!$Z$2:$Z but I get an error


    Please Login or Register  to view this content.
    Last edited by Jerseynjphillypa; 07-30-2012 at 08:27 AM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,960

    Re: Showing Active range for Chart

    Dim LastRow as Long
    LastRow=Sheets("whatever?").Cells(Rows.Count,"Z").End(xlUp).Row

    ActiveChart.SeriesCollection(1).Values = "='Table'!$Z$2:$Z$" & LastRow
    Ben Van Johnson

+ 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