+ Reply to Thread
Results 1 to 3 of 3

If "B25" > 0 then .printout .email and .save

  1. #1
    Registered User
    Join Date
    03-30-2012
    Location
    Tamworth, EN
    MS-Off Ver
    Excel 2007?
    Posts
    14

    If "B25" > 0 then .printout .email and .save

    Hi guys, I feel like I'm so nearly there but I just can't seem to get the code to work ^^

    I have about 30 sheets. The first sheet contains all of our offices' contact details and invoice information for the current month (invoice id, amount owed etc). The other 29 or so sheets pull all of their information from the cover sheet. We don't always get invoices from every office every month so I want to be able to click a button that will check cell "B25" on each sheet (excluding the first sheet if possible). Cell B25 on my sheets is the cell that shows the total value of the invoice for that month. B25 is currently set as a currency cell and it's formula is simply "sum(B4:B23)".

    What I would like to happen is that the 29 'other' sheets get checked for any value in B25 (i.e. any amount owed this month). If there is an amount there then I would like the sheet to print. I would like every sheet to be checked and printed from the click of one button.

    Here's what I have at the moment:

    Sub PrintSheets()
    Dim sh As Worksheet
    For Each sh In ThisWorkbook.Sheets
    With sh
    If .Range("B25").Value >= 0.01 Then ActiveSheet.PrintOut
    End With
    Next sh
    End Sub

    Thanks for any help in advance!

    ----------------------------------------------------------------------------------

    P.S

    I haven't started looking for any help with this section yet but again, any help would be great, sorry if I'm a simpleton.

    I also want the button to then save the document to a specific file location at the end (once it has checked every sheet). How do I go about doing this?

    Also, on the cover sheet I also have each office's contact email address. What I would REALLY REALLY REALLY like to happen () is for the same or a similar button to email a copy of the sheet (just the sheet, not the workbook) to the respective office. So again, if B25 has any value then the button should print the sheet and email a copy to the relevant email address, then once it has checked every sheet, I would like it to save to a specific location.


    Thanks again :D:D

  2. #2
    Registered User
    Join Date
    03-30-2012
    Location
    Tamworth, EN
    MS-Off Ver
    Excel 2007?
    Posts
    14

    Re: If "B25" > 0 then .printout .email and .save

    cheeky bump

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: If "B25" > 0 then .printout .email and .save

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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