• 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

print|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / print|VBA & Macros|Excel Forum|My Online Training Hub

vba course banner

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 & Macrosprint
sp_PrintTopic sp_TopicIcon
print
Avatar
ofer moshe
Member
Members
Level 0
Forum Posts: 8
Member Since:
August 5, 2022
sp_UserOfflineSmall Offline
1
August 5, 2022 - 7:26 am
sp_Permalink sp_Print

Hello VBA cannons
I have a report in cell A1 the date
I want to print a number of reports that each time the date will be increased by a day.
Or a second option to write from date to date for example: 1/8/22-15/8/22
And I will print everything and each printing will cost a day?
Thanks

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1824
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
2
August 9, 2022 - 2:23 pm
sp_Permalink sp_Print

Hi,

You want to  print  to active printer or to pdf?

Avatar
ofer moshe
Member
Members
Level 0
Forum Posts: 8
Member Since:
August 5, 2022
sp_UserOfflineSmall Offline
3
August 10, 2022 - 5:29 am
sp_Permalink sp_Print

active printer

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1824
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
4
August 10, 2022 - 3:15 pm
sp_Permalink sp_Print

Simply use this  code in a standard vba module:

Sub PrintSheet()

ActiveSheet.PrintOut

ActiveSheet.Range("A1").Value=ActiveSheet.Range("A1").Value+1

End Sub

 

In the sheet you want to print,  insert any shape, then right click that shape, click  on Assign  Macros  and assign the PrintSheet macro you just  added.

Avatar
ofer moshe
Member
Members
Level 0
Forum Posts: 8
Member Since:
August 5, 2022
sp_UserOfflineSmall Offline
5
August 11, 2022 - 7:28 am
sp_Permalink sp_Print

Not good!

I want to print automatically with just one click from 1/8/22-15/8/22 a total of 15 pages.

Thanks

Confused

Avatar
Jessica Stewart
Northern USA
Member
Members


Trusted Members
Level 0
Forum Posts: 218
Member Since:
February 13, 2021
sp_UserOfflineSmall Offline
6
August 11, 2022 - 9:50 am
sp_Permalink sp_Print

Could you use that code in a For Each loop?

dim ws as Worksheet

for each ws in thisworkbook

ws.PrintOut

ws.Range("A1").Value=ws.Range("A1").Value+1

next ws

and put it in the workbook BeforePrint event. 

Avatar
ofer moshe
Member
Members
Level 0
Forum Posts: 8
Member Since:
August 5, 2022
sp_UserOfflineSmall Offline
7
August 11, 2022 - 11:48 pm
sp_Permalink sp_Print sp_EditHistory

Please if possible see the file and fix it. Thanks

Avatar
ofer moshe
Member
Members
Level 0
Forum Posts: 8
Member Since:
August 5, 2022
sp_UserOfflineSmall Offline
8
August 16, 2022 - 5:06 am
sp_Permalink sp_Print

Anyone want to help?

please

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1824
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
9
August 16, 2022 - 3:23 pm
sp_Permalink sp_Print

try this one:

Sub PrintSheet()
Dim i As Long

For i = 1 To 14
    ActiveSheet.PrintOut
    ActiveSheet.Range("A1").Value = ActiveSheet.Range("A1").Value + 1
Next i

End Sub

Avatar
ofer moshe
Member
Members
Level 0
Forum Posts: 8
Member Since:
August 5, 2022
sp_UserOfflineSmall Offline
10
August 19, 2022 - 12:03 am
sp_Permalink sp_Print sp_EditHistory

WinkWinkWinkWinkWinkWinkWinkWinkWink

Champion

Avatar
ofer moshe
Member
Members
Level 0
Forum Posts: 8
Member Since:
August 5, 2022
sp_UserOfflineSmall Offline
11
September 1, 2022 - 5:14 am
sp_Permalink sp_Print

Hi I don't understand why it prints me half a page wide?

can i help please

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

You have to set the print area, the code does not do that, just prints what you have set.

You can view the print area from ribbon: View>Page Break Preview, you have that icon next to the page zoom slider on bottom left. Drag the blue page breaks to organize them.

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Bright Asamoah
Guest(s) 10
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: 218
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Gilbert Lemek
Ashleigh Farquharson
Jayz Luu
Fred Smith
Charles DeGraffenreaid
Cathi Giard
Sarah Young
Henry Delgado
Alita Nieuwoudt
KL KOH
Forum Stats:
Groups: 3
Forums: 24
Topics: 6360
Posts: 27812

 

Member Stats:
Guest Posters: 49
Members: 32340
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.