• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Saving to pdf and next number|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Saving to pdf and next number|VBA & Macros|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosSaving to pdf and next number
sp_PrintTopic sp_TopicIcon
Saving to pdf and next number
Avatar
Melanie Olivant
Member
Members
Level 0
Forum Posts: 12
Member Since:
May 29, 2019
sp_UserOfflineSmall Offline
1
June 28, 2019 - 1:40 am
sp_Permalink sp_Print

Hello again, 

I'm looking for solutions to automate our manual invoicing/credit/proforma workbook.  I have 200+ worksheets in a workbook and it takes forever to open and close.

At the moment, I have generated a command button where I can save the worksheet as a pdf and file, but it saves as "False.pdf" every time. I thought I was picking up the invoice number by using cell A3 in the code, which is where it lives on the invoice.  I would also like to be able to pick up while saving if it is an invoice/credit etc.. the cell is A1 on the invoice and is data validated to a drop-down box.    I would appreciate help to figure it out, please.

Sub CommandButton1_Click()
'pdf format
Sheet1.Range("A1:J54").ExportAsFixedFormat x1Typepdf, Filename = "U:\Groups\4. Accounts\Manual Invoice\Manual Invoice pdf 2019.20.1" & Sheet1.Range("A3").Value, openafterpublish:=True

End Sub

In the same command box, I'm looking to go to the next invoice number once the pdf is saved and generated.  I have the code for that and it works fine on a separate sheet but not within the command button.  Do I need to run this as a separate macro/separate button?

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1824
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
2
July 1, 2019 - 1:32 pm
sp_Permalink sp_Print

Hi Melanie,

Can you prepare a sample file with your code? It will be easier to evaluate what you have or generating the next numbers and saving to pdf.

Avatar
Melanie Olivant
Member
Members
Level 0
Forum Posts: 12
Member Since:
May 29, 2019
sp_UserOfflineSmall Offline
3
July 1, 2019 - 7:12 pm
sp_Permalink sp_Print

Hi Catalin

Thanks for getting back to me.  I'm not having much luck in inserting a link for you, it keeps coming up blocked.

Can I reply to the email instead?

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1824
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
4
July 1, 2019 - 9:43 pm
sp_Permalink sp_Print

Try simplifying your file and upload it here directly, no links needed.

Avatar
Melanie Olivant
Member
Members
Level 0
Forum Posts: 12
Member Since:
May 29, 2019
sp_UserOfflineSmall Offline
5
July 2, 2019 - 8:08 pm
sp_Permalink sp_Print

Aha! Found the bit to upload.

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1824
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
6
July 2, 2019 - 11:14 pm
sp_Permalink sp_Print

Hi Melanie,

I see you have a code for setting the next number, you just need to call the NewInvoice code after you save as pdf:

Sub CommandButton1_Click()
'pdf format
Sheet1.Range("A1:J54").ExportAsFixedFormat x1Typepdf, Filename = "U:\Groups\4. Accounts\Manual Invoice\Manual Invoice pdf 2019.20.1" & Sheet1.Range("A3").Value, openafterpublish:=True
Call NewInvoice
End Sub

Avatar
Melanie Olivant
Member
Members
Level 0
Forum Posts: 12
Member Since:
May 29, 2019
sp_UserOfflineSmall Offline
7
July 3, 2019 - 6:12 pm
sp_Permalink sp_Print

Hi Catalin,

I can't believe that's all that was missing!  Thank you so much for your help, working a charm now - just need to take the plunge and go "live"

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Geoff McClure, Riny van Eekelen, David Jernigan, Cassie Bernier
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 215
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Abisola Ogundele
MARTYN STERRY
Rahim Lakhani
Ngoc Qui Nguyen
Clement Mansfield
Rose .
Bindu Menon
Baruch Zemer
Purple RainbowBenefactor
MOTH Junkie
Forum Stats:
Groups: 3
Forums: 24
Topics: 6350
Posts: 27773

 

Member Stats:
Guest Posters: 49
Members: 32317
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.