+ Reply to Thread
Results 1 to 3 of 3

Copy values within date range and to replace old values

  1. #1
    Registered User
    Join Date
    05-26-2022
    Location
    Eindhoven
    MS-Off Ver
    Office 365
    Posts
    18

    Copy values within date range and to replace old values

    Hello,

    I am looking to create a macro that will copy data within tab 'GraphCalc' from column A to C (Except the first two rows).
    This data has to be copied to column J to L (again, except the first two rows).
    It needs to copy the cells when they are within the range of F3 and F4 (within tab 'GraphCalc').
    I know how to copy data within a certain range when it is hardcoded in the macro but not how to set this dynamically.

    Before it copies it has to remove all information in column J to L (again, except the first two rows).
    As the range noted in cell F3 and F4 comes from the graph tab, I'll put the trigger there (as the GraphCalc sheet will be hidden to the user).

    I will initially use this to create multiple dynamic graphs.
    After the data is copied, the graph needs to show only the range that is available there.
    My idea is to do this via the offset function.

    I hope this is clear and that someone can help me.
    I am quite stuck on this.

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Copy values within date range and to replace old values

    Try
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-26-2022
    Location
    Eindhoven
    MS-Off Ver
    Office 365
    Posts
    18

    Re: Copy values within date range and to replace old values

    Hi,

    Thank you. That worked like a charm!

    Question though, I configured the destination as a table. I know that using that way can be used for creating dynamic graphs. The only thing I see happening is that it also uses the date column as a line.
    So it sees it as values, although I've configured it as date. Thereby it is placing (random) values (1, 2, 3,.....) on the x axis - this is where the date should be.
    I get a better result by using the offset function and the name manager. Only then it seems that it uses random dates, not the ones I created. The amount of point is correct though. With the side note that when data is removed it stops working correctly.

    The only way I found that it picks up the date is if only the cells of value are selected. Therefore I am wonderering how to add to the macro that it selects all available values and creates the graph (and when running again that it removes the graph in question. Assuming there are also other graphs).
    Ofcourse I am open for better ways to create a dynamic graph considering the data shown in the first post.

+ 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] copy specific columns and replace values & calculate values from sheet to another
    By abdo meghari in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-04-2021, 04:30 AM
  2. [SOLVED] Trying to copy range of values from one WB to another by finding date in list
    By robxl in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-13-2020, 08:56 PM
  3. [SOLVED] Count number of values dependent between horizontal date range based on 2 date values
    By dcad81 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-06-2015, 08:16 AM
  4. [SOLVED] VBA Code needed to match a date and then copy a range and paste values
    By ettamucci in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-11-2015, 08:13 AM
  5. Replies: 8
    Last Post: 03-31-2015, 01:06 PM
  6. Need help making a macro to copy range of values based on cell values.
    By zolton in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-23-2013, 08:58 AM
  7. Check if Date is in Range, Copy row values and paste into new sheet
    By learning123 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-12-2012, 03:11 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