+ Reply to Thread
Results 1 to 7 of 7

Browse to Folder to complete formulas

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,056

    Browse to Folder to complete formulas

    Almost daily I get invoices from vendors about services they've performed for our caseworkers. The vendor sends me the CW name (somewhat; it's misspelled, or only the first name, or only the last, etc) and the employee ID (also problematic; supposed to be 11 digits, I get anywhere between 0 and 15). For each invoice there are usually 200 plus lines of expenses, sometimes MANY more.

    We have 17K CWs. Our IT dept creates an Active Position Report (APR) ALMOST every day that lists each employee and all the pertinent information about each one. I use the APR from the date of the expense to look up the Dept, Program, and other coding elements so we can charge each expense to the right bucket.

    Each APR is stored in the APR folder, then under the Fiscal Year, then under the month of the FY. The name of the APR is pretty static, other than that it has the date in the file name, so each APR is different.

    Since there's a lot of setup to be done for each invoice, I created the macro below to help me out with it. It's a big help, but one part is big pain.

    I have the path to the APR hardcoded in (see section in red). So, since very seldom do I need the same APR more than a few times, I have to constantly update my macro or alter the formulas after they're desposited.

    What I'd like is to be able to browse to the folder and select the APR I need, and have the formulas adjust to use my selected APR.

    You'd think with all the Covid-19 time I'd be able to work through it, but I'm staying pretty busy so haven't had the opportunity to tackle it, so hoping some kind soul will help me out on this. Any help is appreciated.

    Thanks!

    Please Login or Register  to view this content.
    I know I'm not stupid, but I suspect I'm a lot stupider than I think I am

  2. #2
    Valued Forum Contributor
    Join Date
    06-22-2018
    Location
    Blackpool, England
    MS-Off Ver
    2019
    Posts
    408

    Re: Browse to Folder to complete formulas

    Try popping this at some point before you need the variables, then you can substitute the file paths in the vlookup formulae with them.
    Please Login or Register  to view this content.
    Now your your vlookup formulae can look something like this (untested, so might need tweaking):
    Please Login or Register  to view this content.
    Like I said, untested, but can be a starting point.

    Tim
    Last edited by harrisonland; 04-16-2020 at 08:28 PM.
    Never stop learning!
    <--- please consider *-ing !

  3. #3
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,309

    Re: Browse to Folder to complete formulas

    Possibly...
    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,056

    Re: Browse to Folder to complete formulas

    Thanks guys. I'll play with both of these today and try to get back with you later this afternoon. Thanks for the ideas!

  5. #5
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,056

    Re: Browse to Folder to complete formulas

    Harrisonland,
    Your pseudo code worked flawlessly. It was close to the code I was cobbling together, but I was going the route of replacing "\FY" with "\[FY" and ".xlsx" with "xlsx] to get the formula right. Breaking up the strFilePathName into the two components is a much smarter way, so that's what I ran with.

    Dangelor,
    I gave your code a spin. I did a Debug.Print of the sFileName, which showed this:
    Please Login or Register  to view this content.
    , so in the formulas for DeptID and PAC the second bracket was added appropriately, but no first bracket was added. so the formula was invalid.

    Thanks to both of you for helping me through this. This makes my work much easier!

  6. #6
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,309

    Re: Browse to Folder to complete formulas

    Thanks for letting me know. Glad you got a solution! And thanks for the rep!

  7. #7
    Valued Forum Contributor
    Join Date
    06-22-2018
    Location
    Blackpool, England
    MS-Off Ver
    2019
    Posts
    408

    Re: Browse to Folder to complete formulas

    Glad you got it worked out - and thanks for the rep.

    Tim

+ 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. ShellApp.BrowseForFolder to give Default Folder and allow browse for any Folder
    By Doc.AElstein in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-24-2016, 11:04 AM
  2. [SOLVED] vb macro browse folder
    By ccs_1981 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2012, 05:46 AM
  3. Different 'Browse for Folder' dialog?
    By Jon.R in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2011, 02:30 PM
  4. Browse for folder error
    By abousetta in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-29-2010, 05:26 PM
  5. Browse folder in Excel X
    By kamz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-27-2007, 03:51 PM
  6. [SOLVED] Browse for folder
    By Steph in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2005, 12:55 PM
  7. browse to find folder
    By bhofsetz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-10-2005, 01:58 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