+ Reply to Thread
Results 1 to 2 of 2

Move Data Based on result of a combo box to another tab and archive by date

  1. #1
    Registered User
    Join Date
    08-21-2013
    Location
    NE
    MS-Off Ver
    2013
    Posts
    42

    Move Data Based on result of a combo box to another tab and archive by date

    For some background... I receive data from different departments within my company. For reporting purposes we combine like data for a commodity and archive it for reporting purposes. I have a workbook that has 75 historical tabs. In the mindset of efficiency I have created a "Entry Form" to eliminate going tab by tab entering data. On this "entry form" I have created a calculator for me to enter the like data. I have a combo box that provides a list of commodities. In the attached example they are labeled as "Test 1" and "Test 2" there will be many more, but for example purposes I just used 2. The command button would then move that data to the corresponding historical tab to set cell ranges based on the results of the combo box via a Case. On each historical tab I have Worksheet change sub that would then go down column B and find the date provided and archive the volume, price range and weighted average price basis of the data box in the top left hand corner of the historical worksheet. This all works very well, but I know that this can be simplified... Because of multitude of tabs and redundant coding this program is very slow to save and that is why I am trying to simplify it.

    What I am trying to do is simplify the code and remove a couple of steps it makes. First of all I am combining all the historical tabs into one tab. So instead of having "Test 1" data on a tab and "Test 2" on a separate tab so on and so forth, I am combining them into one tab (as shown in the attached example). I still want to keep the "Entry Tab" because I have it performing other tasks that are not relevant to this question. Secondly I am wanting to bypass the step of moving the data from the "entry tab" to the data table (top left hand corner) on the historical tab. This will allow me to remove the data archival code on the historical worksheet/worksheets. In the attached example you will see that I was trying to still send the relevant data to the "Test Archive" tab in the upper left and corner of the worksheet. Then have the "Case index" archive basis of combo box result. I attempted to modify the "historical tab" worksheet change sub to work in each Case example, but I have hit wall. Therefore I am coming to the experts for help.

    So to the root of the problem... I need help with the code attached to the command button so that after I enter data into the "Entry Form" Calculator, select a "Test" from the combo box and click the "Archive Data" command button. The command button Case will look at what is selected in the combo box, look for that "Test" on the "Test Archive" tab, find the date provided D4 of the "Entry Form" tab and archive the volume, low price, high price, and the average price calculated in AB5 (I did not create a worksheetFunction.sumproduct for this step because I have some commodities that we don't have volume for. Therefore I can only archive a simple average. You will see I have an IF statement in that cell that calculates either a simple or weighted average) The commodities that only have a simple average will be archived on a different tab prompted by a different command button. I intend to simply duplicate the code you assist me with for the simple average archiving. I know that I have bounced around, so if I am not clear in the intended results let me know.

    Thank you in advance for any help you can provide.
    Attached Files Attached Files
    Last edited by rlh; 03-16-2017 at 03:42 PM. Reason: solved

  2. #2
    Registered User
    Join Date
    08-21-2013
    Location
    NE
    MS-Off Ver
    2013
    Posts
    42

    Re: Move Data Based on result of a combo box to another tab and archive by date

    Formula: copy to clipboard
    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. [SOLVED] Move row from sheet to archive in a macro
    By mmccra2858 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-22-2016, 09:58 AM
  2. Move data based on date
    By tommywat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2015, 08:26 AM
  3. Move a Row to archive sheet - Values Only
    By lyla22 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-26-2015, 07:16 PM
  4. Move data fro one sheet to another based on date
    By Clemme in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-24-2013, 08:22 AM
  5. [SOLVED] Once a certain date has been reached, copy row of data to archive tab in same workbook
    By photochic10 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2013, 10:24 AM
  6. Move data from multiple tables onto a list to archive and analyse
    By sallyfield in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-13-2012, 11:52 PM
  7. Move a Record to Archive
    By dreicer_Jarr in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-14-2011, 10:22 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