• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Additional print options for macro and how to total invoices during loop

wnorrick

Member
Help. See below for solution to prior request. This worked great to print out the 200+ invoices. Now, however, i have been asked if I can do two additional things with the invoices. One, create a total of the billed amount and two perform the same procedure on a second invoice in the workbook. So for the total of billed amount it would be great if the total of each invoice posts to another worksheet along with property name as the macro goes through the loop, is that possible? For the second part iIjust need to know how to make it perform the procedure on a different invoice template in the same workbook. Also, is it possible to have each invoice as it is calculated either print to a pdf or copy/paste to a new worksheet?
I really appreciate all of the help available on this forum and how great people are to help others learn more in all things excel.
Wanda



Here is my first question and the solution that worked and the sample workbook to make it quicker for you.

I am trying to set up a way to produce an invoice for over 200 accounts working from the invoice template, a drop down list for each account and a worksheet that looks up values based on each account. I have attached a mini sample. on the invoice if you select one of the accounts it does a look up on the property tab to get data on number of beds and property code then enters that on the invoice. It also does a look up based on the Annual tab to determine costs. The idea is to select a property/account, it populates the invoice and then it either needs to automatically print or preferable go to it's own tab. There will be over 200 of these so doing them individually will be time consuming. Is there a way to automate some of this or all of it? Is there a better way to set it up? i have thought about setting up over 200 worksheets and then linking information from a master worksheet somehow. So even VBA that would duplicate the invoice template for each property in the drop down or the list on the property tab would help some. This one will be annual but will need a similar one for monthly.
i am just going in circles on the best way to go about this. All suggestions are welcome.
Thank you, Wanda

Sub test special()

With Sheet1

For I& = 1 To .Cells(Rows.Count, 15).End(xlUp).Row

.[C9] = .Cells(I, 15).Value

.Range("A1:H47").PrintOut

Next

End With


End Sub
 

Attachments

  • Master Billback template 06242016 (2).xlsm
    115.1 KB · Views: 1
What would be connection of that sample-file with Your request?
Could You add 'some' samples (images or what ever) of Your requests?
 
I am so sorry. I attached the wrong file. Please see the file below. I have also replaced the first one above.
 

Attachments

  • Master Billback template 06242016 (2).xlsm
    115.1 KB · Views: 3
Much better file ... but some terms and so on?
Where are those over 200 accounts or any of those?
Where are few samples which would show Your request?
I would like to get better vision before start.
One things is sure!
Do not make over 200 worksheets and linking...!
 
The sample file is just to get it to work as a test without over 200 properties being listed and printed. I just used dummy data. What the macro that was provided to me does is it starts on the Annual Invoice worksheet, looks up the property in the list in column o, gets the bed count (from the properties worksheet) and then working off of the costs on the annual worksheet calculates the correct charges for that property. It then loops to the next property in column o and does the same. Of course I am sure you see that. The actual list has over 200 properties. This part works great. I can run the macro and it will print all 200+ invoices with their correct charges. The problem I have now is if we print on the office main printer on the server it asks for a code to charge the job to. We have to enter it for each invoice so that is time consuming with over 200+. So i either need to be able to enter the code once at the beginning of the print job or print to pdf and then print that file(s). Does that help explain better? I really appreciate the help and any suggestions you may have.
 
As I wrote:
Where are few samples which would show Your request?
I would like to get better vision before start.
 
I have attached the sample file that will print the invoices. This is dummy data but if you run the macro you will see it print the invoices for this very small group. This works great on the actual file. I just need to either be able to enter the code for the printer one time instead of 200+ or be able to print to pdf so i can then print the file. Thank you for your help.
 

Attachments

  • Master Billback template 06242016 (2).xlsm
    115.1 KB · Views: 4
Okay ...
Read instructions before
Save that file to own folder and make 'PDF'-subfolder for PDFs.
after that You could Test this version.
 

Attachments

  • Master Billback template 06242016 (2).xlsm
    124.2 KB · Views: 5
Last edited:
i set up a folder for PDF and then ran the test. i entered a date printed on the property worksheet but I can't find the pdf. Also, please explain how you did this so I will understand. I try to learn from the help I get here rather than just have someone do it for me. I also saw there was a password in the file. Please share that with me. I really appreciate your help and this looks like it may work once I get it set up correctly.
 
Create folder named "PDF" in the same directory of this workbook
Put some values in column A in sheets("Properties")
Back to worksheet ("Annual Invoice") and click the form button "PDF" ..
PDF files would be created successfully

As for the code used : right click sheets("Annual Invoice") >> View Code
 
... and can You 'print' sheet from Excel as PDF?
There should be PDF-file named like yyyy-mm-dd '4numbers'.pdf.
What do the message-box give? How many PDFs?
There is NO password, it's only protected.
... and still waiting those samples.
 
It worked this time. Thank you both for all of your help. I will drop it in my actual workbook and see how it goes. The other part of my question in my first entry at the top of this chain was is there anyway to capture the total invoice amount in a list as it loops through the different properties. This would be the original step rather than in the pdf part. If you have a solution for that too you will save me an enormous amount of time. It is so wonderful that people like both of you will give your time to help others learn more about excel.
 
about 'Your first entry' ...
Could You now make sample for clear vision
how would do it 'manually' with sample values and wanted results?
Especially how to solve those values!
 
Back
Top