VBA Macro help please

JohnRob83

New Member
Joined
Jun 5, 2023
Messages
7
Office Version
  1. 365
Platform
  1. Windows
hi all,

please can someone help me?

i have a file called InvoiceTemplate.xlsx which is an invoice. i have a separate file called InvoiceData.xlsx which contains multiple rows of data. id like a macro that would save the Invoice Template multiple times(50 times) loop until finished, update certain cells and rename the file based on the data from InvoiceData.xlsx

i have spent many hours trying to find a solution with no luck.

InvoiceData.xlsx contains as follows:
  • Cell A4 - File name - to be used to save the template file as
  • Cell B4 - Invoice number
  • Cell C4 - Invoice date
  • Cell D4 - Net amount
InvoiceTemplate.xlsx contains
  • Cell H9 - Invoice number
  • Cell H8 - Invoice date
  • Cell G5 - Net amount
both files are on a server but for testing you can assume they are both saved in C:\manual invoices\test

any help would be greatly appreciated, i have used macros before but for formatting and i am really struggling with this.

thanks
JohnRob83
 
You are welcome. I trialed it again and it works as before. If you have data in sheet1 A4:D & Lastrow of your Invoicedata.xlsm file then it should work. Good luck. Dave
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
That was tested with Office 2016 on Windows 10. I just trialed on Office 2021 on Windows 11.... works faster. Dave
 
Upvote 0
Hi Dave,

Fresh eyes this morning worked a treat! i had 2 macros called the same thing, one in personal workbook and the other in the Invoice data workbook. when i try to run it ive chosen the personal workbook one, hence why it wasnt bringing any data back!

thank you for all the help, it really is appreciated, you are a legend!!
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,952
Members
449,095
Latest member
nmaske

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
Back
Top