Extracting invoice data and saving as a PDF

cgtx82

New Member
Joined
Mar 26, 2025
Messages
3
Office Version
  1. 2019
Platform
  1. MacOS
I have a self created excel sheet with invoice amounts that I email weekly, based on a pay period date range. I input the cell data, post the date range, and the spreadsheet autocalculates the total invoice amount between the dates specified.

I am attempting to automate this process, where either a macro or VBA code is attached to a button that will save the invoice as a PDF, automatically setting the print tile range in excel to only the array data contained within the pay period date range provided. I am at a loss here, and I know it will require formulas within formulas to achieve the desired effect.

So, to recap, I need to create a button that will look at the pay period dates, save an invoice as a PDF by automatically opening page layout > print tiles > and edit the fields based on the date range I input within the pay period fields in excel. The print tiles "print area" is based on row numbers and columns. So I need it to find the date range, extract the row numbers and columns, and paste that info into the “print area” field in the print tiles section. Then save it as a PDF by clicking the button.

The PDF name also must be formatted as the pay period dates in this exact format: “MM/DD/YY - MM/DD/YY”. Also needs to save it as a PDF in a specific folder in the cloud.

I assume this must be VBA. Can’t imagine an excel formula or macro can do all that.

I need help here. I dont have enough experience in VBA or formula creation to achieve the desired effect im looking for here.
 

Attachments

  • Screenshot 2025-03-26 at 7.02.14 PM.jpg
    Screenshot 2025-03-26 at 7.02.14 PM.jpg
    139 KB · Views: 6
  • Screenshot 2025-03-26 at 7.01.32 PM.jpg
    Screenshot 2025-03-26 at 7.01.32 PM.jpg
    170.6 KB · Views: 7
  • Screenshot 2025-03-26 at 7.01.10 PM.jpg
    Screenshot 2025-03-26 at 7.01.10 PM.jpg
    243.4 KB · Views: 7
  • Screenshot 2025-03-26 at 6.59.58 PM.png
    Screenshot 2025-03-26 at 6.59.58 PM.png
    115 bytes · Views: 8
I have a self created excel sheet with invoice amounts that I email weekly, based on a pay period date range. I input the cell data, post the date range, and the spreadsheet autocalculates the total invoice amount between the dates specified.

I am attempting to automate this process, where either a macro or VBA code is attached to a button that will save the invoice as a PDF, automatically setting the print tile range in excel to only the array data contained within the pay period date range provided. I am at a loss here, and I know it will require formulas within formulas to achieve the desired effect.

So, to recap, I need to create a button that will look at the pay period dates, save an invoice as a PDF by automatically opening page layout > print tiles > and edit the fields based on the date range I input within the pay period fields in excel. The print tiles "print area" is based on row numbers and columns. So I need it to find the date range, extract the row numbers and columns, and paste that info into the “print area” field in the print tiles section. Then save it as a PDF by clicking the button.

The PDF name also must be formatted as the pay period dates in this exact format: “MM/DD/YY - MM/DD/YY”. Also needs to save it as a PDF in a specific folder in the cloud.

I assume this must be VBA. Can’t imagine an excel formula or macro can do all that.

I need help here. I dont have enough experience in VBA or formula creation to achieve the desired effect im looking for here.
not sure what is going on with the pics uploaded. things clearly got messed up when I was attempting to play with formulas. see the uploaded image below for the correct data that I would typically use in print tiles for the given screenshots.
 

Attachments

  • Screenshot 2025-03-26 at 7.25.22 PM.png
    Screenshot 2025-03-26 at 7.25.22 PM.png
    132.4 KB · Views: 5
Upvote 0

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