+ Reply to Thread
Results 1 to 2 of 2

macro to automatically create formulas for daily summary

  1. #1
    Registered User
    Join Date
    04-01-2010
    Location
    Worcester, UK
    MS-Off Ver
    Microsoft 365 (subscription)
    Posts
    50

    macro to automatically create formulas for daily summary

    Hi everybody,

    I need your help with that task:
    I've got a summary workbook which contain information about daily performance of lines in one of the department in my factory.
    Informations are coming from daily files - called with this format "MBmmdd", where MB means code of department, mm is month and dd is of course day; for example for
    6th June it will be MB0606.
    I made formulas (VLOOKUP) to pull out info from daily file into the summary workbook but the problem is that every day I need to copy the formula from day before and change name of source file in that formula plus daily input files can't be generated up front so if I want to prepare formulas up front source files doesn't exist so I need to do a lot of ESCaping if you no what I mean.
    What I am looking for is a macro which will automatically create formulas for all blank columns up to day before (because info is one day backdated and today we are inputting data for yesterday and so on), saving my time on copying and then changing the name of source file in the formulas.
    I want macro to create formulas only for those columns which are blank because some of the formulas after some time I am replacing with "values only" to prevent file from growing to big.
    Is this even possible?

    Thanks in advance for any help.

    PS. I have uploaded sample summary workbook with formulas I am using so maybe that will help and better explain what I am trying to get.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: macro to automatically create formulas for daily summary

    Hi jarssonn;

    Took me a while, but I finally found this formula in U308. I presume that is one of the formulas you want to make easier to copy.
    U308 : =IF(ISERROR((HLOOKUP(U$4,'F:\Continuous Improvement\Jaro\_SIC_\Factory Efficiency Report\MAIN BAKERY\2010[MB0630.xls]MB Summary'!$B$19:$I$350,$A308)))," ",(HLOOKUP(U$4,'F:\Continuous Improvement\Jaro\_SIC_\Factory Efficiency Report\MAIN BAKERY\2010\[MB0630.xls]MB Summary'!$B$19:$I$350,$A308)))

    Try this:
    T309 : 6/29/10

    U308 : =IF(ISERROR(U312)," ",U312)
    U309 : =T309+1
    U310 : =TEXT(U309,"MMDD")
    U311 : ="'F:\Continuous Improvement\Jaro\_SIC_\Factory Efficiency Report\MAIN BAKERY\2010\[MB"&U310&".xls]MB Summary'!$B$19:$I$350"
    U312 : =HLOOKUP(U$4,indirect(U311),$A308)

    Hide rows 309:312

    I put the Hlookup in a separate cell, so it only has to execute once. Your formula had it executing twice when there was no error.

    Do the same for the rest of the formulas in column U, and you should be able to then just copy column U into column V the next day.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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