VBA Invoices print with Name change from Table list

RasGhul

Well-known Member
Joined
Jul 15, 2016
Messages
611
Hello All,

If someone could help with an VBA solution for my sheet please. I have a list of clients in a Table, ([MembersTBL[Name]) and a sheet tab called Invoice which is a generic invoice template.

I would like VBA code to grab each name from the list and change the client name in the generic invoice template then print each client's invoice

The Sheets("Invoice").range("F7").value is where the name field is for the invoice.

Any help would be much appreciated.

Regards

Jason
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Osvaldo Palmeiro

Well-known Member
Joined
Feb 24, 2009
Messages
653
Office Version
  1. 365
Platform
  1. Windows
Hello, ,Jason.
Try this, please.
VBA Code:
Sub PrintInvoices()
 Dim c As Range
  For Each c In Sheets("SomeSheetName").Range("A2:A" & Sheets("SomeSheetName").Cells(Rows.Count, "A").End(3).Row)
   Sheets("Invoice").Range("F7") = c.Value
   Sheets("Invoice").PrintOut
  Next c
End Sub
 
Solution

Watch MrExcel Video

Forum statistics

Threads
1,132,701
Messages
5,654,812
Members
418,155
Latest member
demasisi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top