+ Reply to Thread
Results 1 to 5 of 5

VBA Not Copying Dynamic Graph Range When Importing CSV

  1. #1
    Registered User
    Join Date
    03-19-2020
    Location
    Scotland
    MS-Off Ver
    2016
    Posts
    3

    VBA Not Copying Dynamic Graph Range When Importing CSV

    Hi All,

    Hoping someone can help me.

    During isolation I've got some spare time and have created an Excel workbook with a macro that when a button is pressed it will allow the user to select a CSV file. The Macro then creates a copy of a "Template" work sheet which contains a Graph that contains dynamic ranges. The import of the CSV works correctly and everything appears fine except the dynamic range of the graph isn't copied across and it reverts to static references. The OFFSET function and things copys across is the name manager but the graphs dynamic range reference does not.

    I've been trying this for a huge amount of time and not getting anywhere but am sure it is childs play for some of you Excel/VBA experts.

    I have attached the current speadsheet and an example CSV file to load.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    02-19-2020
    Location
    Russian Federation
    MS-Off Ver
    2010
    Posts
    9

    Re: VBA Not Copying Dynamic Graph Range When Importing CSV

    Hi,
    I tested your file and in my case dynamic range of the graph WAS COPIED! But graph wasn't displayed because of wrong datatype.
    So you should replace point symbol on comma symbol in your data values to solve this problem.

  3. #3
    Registered User
    Join Date
    03-19-2020
    Location
    Scotland
    MS-Off Ver
    2016
    Posts
    3

    Re: VBA Not Copying Dynamic Graph Range When Importing CSV

    Hey,

    Thanks for the reply.

    Not sure why yours worked and mine isn't then. When I do it a graph is produced but ti doesn't use the dynamic range like the template one did. See image.

    I'm not sure what you mean by "you should replace point symbol on comma symbol in your data values to solve this problem" - can you clarify for me please?

    Attachment 668045

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VBA Not Copying Dynamic Graph Range When Importing CSV

    Add this to the end of your ImportCSV procedure

    Please Login or Register  to view this content.
    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.

  5. #5
    Registered User
    Join Date
    03-19-2020
    Location
    Scotland
    MS-Off Ver
    2016
    Posts
    3

    Re: VBA Not Copying Dynamic Graph Range When Importing CSV

    Quote Originally Posted by AlphaFrog View Post
    Add this to the end of your ImportCSV procedure

    Please Login or Register  to view this content.
    Seriously, you are an absolute legend - that worked perfectly. Words can't even begin to describe how grateful I am for that. Thanks so much for your help

+ 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. [SOLVED] Dynamic Range Graph Update - Help!
    By k7s41gx in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-10-2018, 12:21 PM
  2. [SOLVED] set dynamic range in graph
    By L-Drr in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 12-16-2013, 12:43 PM
  3. Dynamic range when importing data from Microsft Query
    By johnmitch38 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-18-2013, 06:15 AM
  4. Graph with Dynamic Range
    By Jonathan78 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 09-17-2009, 12:02 AM
  5. Dynamic Range Names For a Graph
    By whiZZfiZZ in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-16-2006, 01:45 PM
  6. Replies: 2
    Last Post: 02-02-2006, 04:10 PM
  7. Replies: 6
    Last Post: 01-25-2006, 02:45 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