Macro Help

C

ChuckF

I have two spread sheets. One called "Lot" the other called "Invoice"

Lot contains all of the billing information for each location.

Store, City, State, Invoice Number, Billing Amount, Sales Tax, Total

I need to compile this data onto the "Invoice" spreadsheet, and print
individual invoices for each store. I figure I will use Vlookup for
everything but the store number, and possibly have a macro input the
store numbers.

Is there a way that I can record a macro to copy the store number
(starting in A7) to the invoice spreadsheet, and have it print....then
copy the data in A8, print...copy A9, print so on and so on, until
there is no more data in A.

Any help you can provide would be great.

Thanks!
 
A

Ardus Petus

I based my solution upon indexing all variable fields in Invoice sheet upon
a named value ("InvoiceIndex")
The PrintInvoices macro varies that value from 7 to last invoice row.

See example: http://cjoint.com/?fEr6sH1M6Y

hth
--
AP

'-----------------------------------
Sub PrintInvoices()
Dim lLastRow As Long
Dim iRow As Long

lLastRow = Worksheets("Lot").Range("A7").End(xlDown).Row

For iRow = 7 To lLastRow
Names("InvoiceIndex").RefersTo = iRow
Worksheets("Invoice").PrintOut
Next iRow
End Sub
'-------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top