+ Reply to Thread
Results 1 to 8 of 8

Need help with dynamic range Sheet.name & range & lastrow

  1. #1
    Forum Contributor
    Join Date
    06-30-2018
    Location
    Azerbaijan
    MS-Off Ver
    Excel 2016
    Posts
    145

    Need help with dynamic range Sheet.name & range & lastrow

    Hello community,

    I am trying to use dynamic range for chart Xvalues

    ActiveChart.FullSeriesCollection(1).XValues = "='MAIN DATA'!$E$3:$E$" & lr

    Instead I want to use

    ActiveChart.FullSeriesCollection(1).XValues = "=" sh.name & "!" & "$E$3:$E$" & lr

    I guess I do something wrong, I get error.
    Any help will be appreciated.

    Thank you.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hello, try this !


    You just forgot the quotes of the original formula !

    ActiveChart.FullSeriesCollection(1).XValues = "='" & sh.name & "'!$E$3:$E$" & lr

    ► Do you like it ? ► So thanks to click on bottom left star icon ? Add Reputation ? !
    Last edited by Marc L; 09-16-2022 at 02:56 PM. Reason: typo !

  3. #3
    Forum Contributor
    Join Date
    06-30-2018
    Location
    Azerbaijan
    MS-Off Ver
    Excel 2016
    Posts
    145

    Re: Need help with dynamic range Sheet.name & range & lastrow

    I tried but it gives error:

    "='" sh.name & "'!" & "$E$3:$E$" & lr
    Expected end of statement

    Attachment 796562

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,704

    Re: Need help with dynamic range Sheet.name & range & lastrow

    It might help if you show where and as what you qualify sh.
    Show your whole code in other words.
    The inherent weakness of the liberal society: a too rosy view of humanity.

  5. #5
    Forum Contributor
    Join Date
    06-30-2018
    Location
    Azerbaijan
    MS-Off Ver
    Excel 2016
    Posts
    145

    Re: Need help with dynamic range Sheet.name & range & lastrow

    Solved

    Please Login or Register  to view this content.
    Last edited by Akbarov; 09-16-2022 at 02:28 PM.

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Need help with dynamic range Sheet.name & range & lastrow


    Yes, sorry, my bad, badly edited on smartphone ...

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Need help with dynamic range Sheet.name & range & lastrow


    As a reminder, the quotes are mandatory when the sheet name contaiins a space ...

  8. #8
    Forum Contributor
    Join Date
    06-30-2018
    Location
    Azerbaijan
    MS-Off Ver
    Excel 2016
    Posts
    145

    Re: Need help with dynamic range Sheet.name & range & lastrow

    Thank you for information

+ 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. Range notation with LastRow
    By MaartenRo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-20-2021, 10:25 PM
  2. [SOLVED] Range A1 to lastrow and last column
    By joepFIMBLE in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-06-2020, 01:27 PM
  3. [SOLVED] Multiple Sheet Export to PDF, one sheet needs specific range based lastrow of data
    By xlyfe in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-25-2018, 07:39 PM
  4. Autofill Data based off current sheet lastrow not first sheet lastrow
    By bcarroll76 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-06-2018, 06:26 PM
  5. [SOLVED] Using range with lastrow
    By luizmachado in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-22-2016, 06:04 PM
  6. [SOLVED] BorderAround for Range (lastRow)
    By Quasis in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-06-2015, 03:01 PM
  7. Copy dynamic range from previous sheet and paste after last used row in a range
    By Mistweaver in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-04-2010, 06:24 PM

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