Pagesetup.zoom excel




















When you record a macro that does anything that involves printing you end up with a lot of VBA Visual Basic for Applications code. The Page Setup dialog interacts with your printer and that requires communications over your network.

This impacts the speed of the macro. In general when you record a macro that involves the Page Setup dialog you should eliminate unnecessary lines of code because each line of code may require communication to the printer and slow the macro down. Because of the speed issue you need to scan the recorded code to find the zoom percentage change. I then did a Google search to identify the code that tells us how many pages are printed. I came across a few pieces of code. I then created the following piece of code that uses a Do Until Loop to increase the zoom percentage until the pages to print is greater than one.

Below the Do Until Loop in the code I reduce the zoom percentage by one which should put the number of print pages back to one page before it went over to two. What to do? I used the Debug. Print prints to the Immediate window in the VBA screen.

You can capture values as the code is running. In Excel you sometimes need to trigger an event to force Excel to do a calculation. That View shows the print with the page breaks. I have added comments green lines to the final code below to explain all the parts of the code.

Dialogs xlDialogZoom. Show I do not believe it is possible to capture the requested value from the Zoom window, without changing the zoom setting. Zoom 'Open the zoom dialog box to change setting Application. Print ActiveWindow. The book contains: example codes to practice reading and writing macros that will embed the language into your thinking.

An introduction to macros in Excel to ensure you can implement the VBA code in the book even if you have no prior knowledge. Consistent code layout between examples to enable you to understand the structure and easily customize the code to meet your needs. Downloadable workbook containing all the source code , so the examples can be added to your project to give you the benefit of VBA straight away.

You will benefit much more by discovering your own solutions. Remember, the people on these forums are generally giving their time for free. Use Excel Rescue , who are my consultancy partner. They help by providing solutions to smaller Excel problems. Rename columns in Power Query when names change. Clear old items from a PivotTable filter list.

Why are Excel formulas not calculating? VBA to sort sheets alphabetically. Office Scripts — Sort sheets alphabetically.

Use Office Scripts with Power Automate. Office Scripts — Hide all sheets except one. Juan, your suggestion looked promising, but the app I'm using does not have the Cbool or equivilent function, and if it had, it would probably still evaluate to a 1 or 0 integer. My current work around is to set FitToPagesTall to around , any much higher above and it shrinks the print to one page again as if setting FitToPagesTall to 1. I even tried to trick it with this solution: objWorkSheet.

Any further suggestions would be appreciated, but I have a feeling it's a limitation of the application which by the way is based on VB 3. What about this then? I'm beginning to think it is a limitation of this application. I've tried the following ws. Range "BA1". Evaluate "False" Set ws. My only other idea is to have the app create a module with the information and then tell it to run that macro.

Thanks for the help. You must log in or register to reply here. Similar threads. Replies 2 Views Dec 2, mackc Solved Formatting the body of an Outlook email? Replies 4 Views Dec 6, jmpatrick. Replies 12 Views Oct 31, Jaafar Tribak. Solved Data validation box popup when select Col A in first empty row, then delete when next cell selected.

Ironman Sep 15, Excel Questions 2 3. Replies 21 Views



0コメント

  • 1000 / 1000