+ Reply to Thread
Results 1 to 6 of 6

Print the list of filenames without submission

  1. #1
    Registered User
    Join Date
    06-28-2016
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    6

    Print the list of filenames without submission

    Hi all,

    I'm very new to VBA and am trying out the coding on my own. I have a list of budget files stored in a folder, and I would like open each of them and refer to a specific worksheet name to check if there is any submission.

    I need to code such that if there is no entry in the table (i.e. none filled at all from columns C - H and rows 3 - 25), the macro should call out the filename and list them in the macro-run workbook and worksheet. The macro will then loop until it has gone through all the budget files stored in the folder. I am not sure how many budget files there would be in total.

    File directory where all the budget files are stored: D:\05. Budget\FY17\Trial\
    Worksheet name where departments will submit request = M.Manpower
    File directory where the macro will be run from: D:\05. Budget\FY17\Budget Consol.xlsm
    Worksheet name for the list of filenames to be called out = None

    I have also attached a sample workbook on how the budget file will look like.

    Appreciate any help / advice on this. Thanks so much!
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,926

    Re: Print the list of filenames without submission

    Will the real budget file have formulas in the range(C3:H25) like the sample does?
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    06-28-2016
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    6

    Re: Print the list of filenames without submission

    Hi dflak, some of the columns would have. Majority would eventually become dropdown list though.

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,926

    Re: Print the list of filenames without submission

    OK, I'll have to do some research. I was going to use COUNTA to determine if any of the cells were filled in. I can't do that since COUNTA (Range) > 0 if the range has formulas even though the cells appear to be blank.

  5. #5
    Registered User
    Join Date
    06-28-2016
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    6

    Re: Print the list of filenames without submission

    Thanks dflak! I've attached another sample which is closer to what I will use eventually.. Basically Column C will have the cost centre appear should the user make any selection from the dropdown menus / input any value from Columns D to G, I to L, N to T. (Column G will trigger a vlookup value in Column H),

    In fact, if nothing is entered within the row (Columns D to G, I to L, N to T), column C's cost centre will not appear.

    Hence, I can do 2 checks here:

    1. Check if column C shows the cost centre number
    2. Columns D to G, I to L, N to T are EMPTY

    Either of the above, my macro should pick up this filename, and list it on another worksheet where I run the macro.

    Sorry to come back to you only now, was still trying to figure out the codes on my own.


    Cheers!
    Attached Files Attached Files

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,926

    Re: Print the list of filenames without submission

    This looks like an entirely different spreadsheet than the original.

    I do have one question. What is the intent of this formula: =IF(COUNTA(D10:L10,N10:T10)>1, INDIRECT("CC"), ""). I get that you are counting up the number of data entries in cells D10, L10, N10 and T10 and if there are fewer than 2 entries, put a blank string. What is the INDIRECT("CC") supposed to accomplish? As it reads now, it returns the range pointed to by the string "CC" which does not make sense.

    Also how do cells E1 and E2 relate to the Department and Cost Centers in columns C and D?

    Also, unless you always have 50 entries you may want to consider putting the data into an Excel Table. Excel tables know exactly how many rows they have and they grow or shrink as you add data. You reference them by column name (intellisense helps a lot here) so your formulas always reference the exact amount of data they need, and you don't have to change them if you change the number of rows in the table.

    Here is an article that will get you started with tables: http://www.utteraccess.com/wiki/inde...ables_in_Excel.

+ 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. Matching list of hyperlinks to outside files, with list of filenames.
    By mmcbride in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-08-2014, 11:32 AM
  2. Replies: 9
    Last Post: 02-14-2009, 01:50 PM
  3. print pdf's with changing filenames in a macro
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-15-2006, 10:35 PM
  4. VBA Script to Print several named ranges to PDF with cell-defined filenames
    By jbmessamore in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-14-2006, 10:34 AM
  5. [SOLVED] List Filenames from Folder
    By Eskimo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-19-2006, 03:45 PM
  6. [SOLVED] List all filenames & tab names
    By Deeds in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-18-2006, 06:20 PM
  7. Getting a list of filenames
    By cottage6 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-13-2005, 12:06 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