+ Reply to Thread
Results 1 to 6 of 6

Audit report

  1. #1
    Registered User
    Join Date
    03-12-2007
    Posts
    61

    How to auto generate a report log

    Hello,

    I have a macro that looks at all excel workbooks in one folder and copies all rows (except row 1) for each of the worksheets that have a value in the first column and consolidates the data into one master worksheet. For example, if there are 12 workbooks, then all 12 will be automatically consolidated into one.

    This is used to consolidate worksheets from multiple users into one spreadsheet.

    In the event a user accidently loads a blank workbook in the folder, I would like a way to automatically identify which one it is. Currently this is manual - opening up the workbooks one by one to see which one had missing data.

    If possible in the master file, I would like another tab to automatically log all the workbooks and worksheets that are in the folder as they are being reviwed by the macro plus identify the number of valid data rows (ie 0, 1, 4, etc)

    Could someone help me with the coding on this as I'm still learning VBA.

    Example of potential log:

    Workbook, Worksheet, Data (# of rows)
    Test File 1, Form, 1
    Test File 2, Form, 2
    Test File 3, Form, 0
    Test File 4, Form, 1


    I am attaching the code I have.

    Thanks, Mary-Lou
    Attached Files Attached Files
    Last edited by mlk; 08-01-2007 at 12:11 PM. Reason: make title more meaningful

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Didn't test this at all, but see how it goes.

    1) Make sure you work with a copy and keep your original intact.
    2) Create a new sheet in your output file called Log.
    3) Beside / above the additional code, I've put a comment 'new so you can see what I've done.

    Please Login or Register  to view this content.

    rylo

  3. #3
    Registered User
    Join Date
    03-12-2007
    Posts
    61
    Hi, thank you very much the code changes.

    I had to some minor adjustments (I bolded the changes below) as it crashed on "set logsheet". I added a line to add a "log" sheet plus I gave the original active sheet a name.

    Your code works awesome and I'm wondering if it would it be possible to only count the actual data rows? Not the blank ones?

    For example, in one workbook I had only 2 lines of data that started in row 3 and this appeared on the log as a 4 instead of 2. Similar thing for a workbook that had no data lines at all but the log showed a 1.

    Thanks, Mary-Lou


    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Mary-Lou

    What sort of data will be in the source files? Numeric, alpha numeric, numeric? Is this data constants, or is it generated by formulas? Are the blanks really blank, not spaces / zeros or the result of a formula ("")?


    rylo

  5. #5
    Registered User
    Join Date
    03-12-2007
    Posts
    61
    The data will be a combination of everything from columns A through to column CA.... but there should always be something in column A. If nothing is in column A, then this can be considered a blank row.

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Again, didn't test this but try changing the line
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

    rylo

+ 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