Posts by DCBatMG

    I am trying to check to see if a file is open, if it is then I simply want to activate it and finish the commands in this macro. If not open, then I want to open it

    Here's my vb

    I have a series of 30 spreadsheets, each of which has "calculate before close" built into it. I am also running an add-in that ties into my general ledger software, so this calculation is a slow process. I need to have all 30 spreadsheets open at the same time and I am looking for a way to disable this calculation when I close the spreadsheets but have it enabled when my users are in the spreadsheet. There are other macros involved, so I can't just disable macros when I open them all. Any suggestions would be greatly appreciated.

    Re: Returning To A Sheet

    Here's my code.

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Sheets("Client Annual Budget").Select
        If Range("C140") = 0 Then MsgBox "Please Budget your Inventory Ratio. Your work will still be saved.", vbCritical + vbOKOnly
    End Sub


    I have a macro that selects a specific worksheet and checks for a value in a specific cell when they save the workbook. I would like to have it return to whatever worksheet that was active when they clicked on save. Is there a way to do this without knowing which sheet in the spreadsheet they will be on?

    Thanks for the help!

    I would like to create a macro that looks at a specifc cell with a formula that compares the values of two other cells on the spreadsheet. If the variance is more that $10, I would like a popup window to come up telling the user that they are not in balance. I would like this to happen when they attempt to save the file.

    Thanks for your help!

    Re: Page Break based on blank cell

    I've attached a scaled down version of the tab from the file that shows what I'm trying to print. The entire file is too big to put on. I've removed the formulas out of the spreadsheet also to make it fit. There was a vlookup formula in column A. The amount of rows can change weekly, plus I use this for 30 locations and each location will have a different amount of rows. I'm trying to get it to have a page break whenever it sees a blank cell in column A. The page setup is landscape and I want the page breaks to be horizontal. Thanks for all your help!

    Re: Page Break based on blank cell

    Thanks for the help so far. I'm running this separate, but it errors on this line

    Set ActiveSheet.HPageBreaks(lPgeBreak).Location = Cells(lRow, 1)

    My sheet name is Inventory
    I'm being brain-dead. What am I doing wrong?

    Re: Page Break based on blank cell

    I'm getting several different errors - so I obvioulsy pasted this in incorrectly.
    Do I want to paste all your code into the existing macro or should I make it a separate macro and have my existing print macro run this?

    I need to insert code to add a page break whenever there is a blank cell in column A. Here's the code I'm using to print. Any help is greatly appreciated.

    Re: Custom Header/Custom Printing

    One last question and I'll let you go. I would also like to set the font to match the font in the center section, which is Black Chancery with a size of 16.
    I really appreciate your help!!

    I have a spreadsheet with Data in columns A thru E. Over in cells G4 and G6 I have info that I want to show up in the left header (G4) and right header (G6), but be updated only when I print. I need to print columns A thru E, but find the last cell with data in either column A or B and make that the bottom of the print Area. I have attached a sample of this spreadsheet. Thanks for taking a look!!