demolady.blogg.se

Resize print area in excel for mac 2016
Resize print area in excel for mac 2016







  1. #Resize print area in excel for mac 2016 for mac#
  2. #Resize print area in excel for mac 2016 code#
  3. #Resize print area in excel for mac 2016 mac#

I’ve posted a simple workbook that illustrates this technique. VColWidths(iCol) = Val(vColWidths(iCol)) * dResizeFactor If dResizeFactor = 0 Then dResizeFactor = gUserFormResizeFactorįor iCol = LBound(vColWidths) To UBound(vColWidths)

#Resize print area in excel for mac 2016 code#

The global resizing factor is placed in an appropriate place in the declarations section of a regular code module: Public Const gUserFormResizeFactor As Double = 1.333333Īnd this routine in a regular code module does the resizing: Sub ResizeUserForm(frm As Object, Optional dResizeFactor As Double = 0#) In Windows, this code is ignored, and the UserForm is displayed without rescaling.

#Resize print area in excel for mac 2016 mac#

When using a Mac, the constant Mac is True, so the code between #If and #End If is compiled and run, so the UserForm is resized. The #If Mac Then and #End If structure indicates a section of code which is conditionally compiled. This calls the routine from the UserForm’s code module: Private Sub UserForm_Initialize() You have to build them into your file in Windows and them move the file to the Mac. Note: While Microsoft has substantially improved the VB editor on the Mac, you still can’t work with UserForms on the Mac. Sometimes a large block of text may not wrap the same, so if it really matters, you should hard code your line breaks by typing Ctrl+Return while entering the text. The dialogs are equally legible, and the text came out pretty much the same. First, it is shown opened in Windows.īelow it’s shown opened on the Mac. Here is a UserForm designed in Windows, but which uses the resizing routine so it displays legibly on either computer. I do make sure when I design the form that controls are more than large enough in case the text takes up extra space. The text still may not always be perfect, since you can only specify whole number font sizes, so I suppose I should always round up the font size. I have developed a simple routine that is called from each UserForm’s initialize event, which changes the size, position, and font of each control by a factor of 4/3.

#Resize print area in excel for mac 2016 for mac#

The Solution: UserForms For Mac And Windows. Every adjustment you make has to be made twice, and it’s hard to remember what changes you’ve made across large projects. But it’s a lot of extra work to lug around two separate versions of every file. The dialogs for each were appropriately sized, and I took care of other coding idiosyncrasies in the separate files. In the past, I supported separate add-ins, one for Windows and the other for Mac. The header text is fine, but the text in the dialog itself is too small to read comfortably. Here is that same UserForm opened on a Mac.

resize print area in excel for mac 2016

The text might seem a bit small to me now that my eyes are getting older, but it’s still perfectly legible. The result is that without applying any correction, UserForms that come out just right in Windows are only 75% as large on the Mac, making them difficult to read.įor example, here is a UserForm designed in Windows, opened in Windows. Confusing the issue is that VBA in Windows uses points as the measurement unit for designing UserForms, while VBA on the Mac uses pixels. In Windows, screen resolution is 72 dpi (dots per inch) and each dot represents a “point”, while pixels are still 96 per inch. On the Mac, it’s 96 dpi, where each dot represents a pixel. One of the most noticeable is related to the difference in screen resolution between the two platforms. There are many annoyances when designing a VBA project to run on both Windows and Mac computers.









Resize print area in excel for mac 2016