+ Reply to Thread
Results 1 to 4 of 4

Macro to copy data on a weekly basis for trend analysis

  1. #1
    Registered User
    Join Date
    04-30-2014
    Location
    Essen, Germany
    MS-Off Ver
    Excel 2010
    Posts
    2

    Macro to copy data on a weekly basis for trend analysis

    Dear all,

    Since I'm fairly new to the whole concept of VBA/Macro I need help. I've attached a sample document in order to create a more tangible situation.

    I'm in the process of creating a management dashboard and I want to include a trend analysis. I'm receiving several data dumps (Forecast & Budget) every week and made a Dashboard sheet linked to these data dumps with the use of formula's. Included in these formula's is an IF formula where blank cells return as "". This enables me to stretch the formula's down in order to always have all data in that one sheet eventhough the data dump get's longer for example.

    The Macro I would like to create is to copy the weekly data from the Dashboard (Location of the Macro button) sheet into the Trend data sheet with exception of the project manager column. Every week we copy the data it pastes the data below last weeks data. To seperate the two weeks I would the Macro to automatically add the week number of TODAY() (the week in which we used the Macro).

    Problems arise because of the IF formula. The cells aren't actually empty so the Macro copies 'empty cells'. Resulting in loads of empty rows every week in between. Secondly I have no idea how to add a data stamp in every row of which the Macro copied data.

    I've started the code in my original file, it actually copies the data and pastes it under the previouse week:

    Please Login or Register  to view this content.
    Can someone please help?

    Thanks in advance.

    Regards,
    Max

    Excel Forum Test file.xlsx
    Last edited by maxmilan; 05-08-2014 at 03:26 AM.

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Macro to copy data on a weekly basis for trend analysis

    Are Budget and Forecast sheets deleted every weeks? I mean you start from scratch every week. This means your Dashboard sheet is a view of only one week of data refreshing itself as the data in the other 2 sheets are changed?
    But you want to keep track of old values in the Trend sheet, right?
    Would you like a macro to populate your Dashborad sheet instead of using formulas?
    Data transfer to the Trend sheet must be run only once, right? Or do you want to run it several times during the week? If this is the case, we'll have to make sure not to create duplicates.

    Let me know how you see all of this.

    BTW, look at rule #3 and make sure you use the CODE TAGS around your lines of code.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Registered User
    Join Date
    04-30-2014
    Location
    Essen, Germany
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Macro to copy data on a weekly basis for trend analysis

    You are right on the money there p24leclerc. The Budget and Forecast data is replaced every week meaning the dashboard is only a weekly view. Because of this method I'm lacking trending information and thus I'm in search of a Macro to copy the data from the dashboard into a sheet which keeps building up with weekly data. I only need 1 copy from the dashboard per week meaning the trend data can only be as big as 52 data copies. Than with the use of pivottables I'll create graphs based on the date stamp (week stamp).

    The Macro i'm looking for applies for the trending data sheet. The dashboard automatically updates when I download the datadumps (in orgininal file the dashboard is linked to datadump files).

    Apologies for rule #3. Hopefully that is solved now.

    I've gotten a little further actually. I've added a IF formula which shows 'END' in the dashboard when there is no more data to be copied from the data dumps. Based on the word 'END' I've managed to let the macro copy the data to the trend sheet in the right cells. The date stamp is my biggest issue at the moment.

    Please Login or Register  to view this content.
    And.

    Please Login or Register  to view this content.
    This last code doesn't seem to work. The first macro copies the data in the column starting from column B. The date stamp I would like to have in column A. So when the value in Column B is "" or blank, column A is blank. When a value is entered in column B, column A shows the date of entering. Meaning the date won't change by day.

  4. #4
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Macro to copy data on a weekly basis for trend analysis

    try this macro, you can adjust the ranges to suit your actual sheets' names.
    Please Login or Register  to view this content.

+ 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. VBA coding to copy paste data on a daily basis to view the trend
    By aravindkm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-10-2013, 06:22 AM
  2. [SOLVED] whether the stock price is raising trend or fallen trend analysis by excel macro
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2013, 09:35 AM
  3. Replies: 1
    Last Post: 03-21-2013, 10:45 PM
  4. Automatically charting data on a weekly basis for a rolling 12 month period
    By xforum142riidax in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-15-2011, 11:05 AM
  5. [SOLVED] Summarize employee attendance data on a weekly basis
    By Hanr3 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-05-2006, 12:00 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