ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Macro Help (https://www.excelbanter.com/excel-worksheet-functions/91284-macro-help.html)

ChuckF

Macro Help
 
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!


Ardus Petus

Macro Help
 
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
'-------------------------------------
"ChuckF" a écrit dans le message de news:
...
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!





All times are GMT +1. The time now is 02:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com