Posts by boombox


    I have an excel workbook 'managing' invoices for me.

    I know Access would be better, but for various reasons it has to be Excel for the moment.

    I have a macro which increments an invoice number and saves a PDF of the invoice.

    I would like to populate two columns on a worksheet within the workbook where it keeps a record of the invoice number and the total amount it was raised for.

    Could anyone help me achieve this?



    Re: Combining multiple workbooks with single sheets into one workbook with multiple s

    Sorry about quoting posts. In another programming forum it's encouraged and common practice due to people deleting or editing posts. I shan't do it here!

    I've tried to implement your check as you posted it, and got a type mismatch. When I tried to peg it on to the end of an existing IF, I get a type mismatch.

    Any ideas?


    Re: Automatic shutdown issues with saving if someone's in the workbook and it's read-

    Quote from jbell;597501

    If a user opens the workbook when another user already has it open, are they getting prompted to open as 'Read Only'. It sounds like that might not be happening.
    You could try picking up any errors when saving and handling them in code rather than getting the ugly VBA default errors. (Code Below)

    This works beautifully, I think. Thank you!

    Re: Combining multiple workbooks with single sheets into one workbook with multiple s

    Thanks, this prompted me to look at my data. Two workbooks only had data on row1. Adding data to row2 resolved the error. I've no idea how to add error checking for that. I don't these particular workbooks merged (row 1 is a header row, so the workbook is effectively empty) but it would be nice for the code not to fail is there is no row2.

    Otherwise, I'm still looking for a way to store the code in personal but perform/store the merge in a new workbook.


    I am trying to use this code. It has worked very well in the past but has stopped working for some reason.

    Here is mine code:-

    I've modified it to combine CSV files.

    Now, it breaks and says 'type mismatch' on this line:

    If LastCell.Value = "" And LastCell.Address = Range("$A$1").Address Then

    Aside from that, I'd like to install this in my personal macro workbook - but have the "result" (the combined workbook) in a new, blank workbook.

    Any tips?


    Every day I run a macro.

    Every day the macro leaves open a source file (it copies info into a new workbook).

    I can't reliably close the source file within the Macro because the source file has a naming format like

    VendorBacklog4343242343 (the numbers aren't a date or anything I can predict). Today's was 82435386 - which I hoped might be Unix time, but this is 1972 in Unix time.

    Anyway I can refer to the file as "filebeginning(VendorBacklog).close" or some such?


    I use the following code to automatically close the workbook after a period of inactivity. It's very much based on the work of others, but I think an improvement, because it works flawlessly (with caveat below) and is simple to implement.
    The problem is if someone else was IN the workbook when the user opened it, the code still tries to save it when they exit, causing all sorts of problems because it can't, so it just plonks a copy of the workbook somewhere in the network share. And it shows an ugly error to the user.
    User Module


    I tried to add IF statements using the boolean variable OPENORNOT to only "" if the answer was FALSE, but that didn't work at all. Any tips? Anyone care to try this out a bit?


    Sub Button1_Click()
    Config = vbYesNo + vbQuestion + vbDefaultButton2
    Ans = MsgBox("Crank it?", Config)
    If Ans = vbYes Then
         Workbooks.Open "C:\boombox\" & Format(Date, "") & ".xlsx"
    ElseIf Ans = vbNo Then
    End If
    End Sub


    I was wondering about a way to modify this code to either
    1) Find out if the workbook exists, and if it doesn't, return an error
    2) If it doesn't, go back in time day by day until a workbook DOES exist.
    i.e. Workbooks.Open "C:\boombox\" & Format(Date, "") & ".xlsx"
    Workbooks.Open "C:\boombox\" & Format(Date, "") & ".xlsx"



    Every day I run a macro:-

    Sub CopyFromALR_To_Matcher()
        Application.CutCopyMode = False
    'Copy PO
        Windows("16.12.11 Bob ALR.xlsx").Activate

    there's more code than that, but I've copied only the relevant bit.

    Basically I'd like to say

    Windows(Today() & "Bob ALR.xlsx").Activate

    or something, instead of having to modify the VB every day.

    Anyone know if this is possible? I have Googled...