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.Excel is printer-intensive, and it will run slower when Excel files are saved in Page Break. 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.Drag a spin button on your worksheet. In the ActiveX Controls group, click Spin Button. On the Developer tab, click Insert. The text might seem a bit small to me now that my eyes are getting older, but it’s still perfectly legible.To create a spin button in Excel VBA, execute the following steps. 4 This means your purchase is For example, here is a UserForm designed in Windows, opened in Windows. 4 The updates will be delivered to you via a free Web Edition of this book, which can be accessed with any Internet connection.
![]() The dialogs for each were appropriately sized, and I took care of other coding idiosyncrasies in the separate files. The header text is fine, but the text in the dialog itself is too small to read comfortably.In the past, I supported separate add-ins, one for Windows and the other for Mac. You can add buttons and forms to add interactive features yet most people.Here is that same UserForm opened on a Mac. Microsoft will continue to push JavaScript APIs as the new VBA replacement across all it’s platforms (PC, Mac, Tablet, Browser) VBA is still something that should be learned and can easily differentiate you from other Excel users.In addition to PivotTables, VLookup formulas and the like, you can also automate it. ![]() You have to build them into your file in Windows and them move the file to 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.Note: While Microsoft has substantially improved the VB editor on the Mac, you still can’t work with UserForms on the Mac. The dialogs are equally legible, and the text came out pretty much the same. First, it is shown opened in Windows.Below it’s shown opened on the Mac. Aside from this, it works pretty nicely.Here is a UserForm designed in Windows, but which uses the resizing routine so it displays legibly on either computer. Do Vba Programs Work In Excel 2016 Download It ByNote that it’s already resized to 1.333333. Yeah, way too small.Here is the same form opened on a Mac. Here is it opened in Windows.Enter a number in the New Form Magnification box (for example 2) and click Apply, and the form is resized accordingly.Enter 1.333333, the ratio between pixels and points, and this is how it will be resized for the Mac, though it’s too large for Windows.Enter 0.75, the inverse of the above, and you get a sense for how small it would be on the Mac without rescaling. Download it by clicking the icon below.When you open the workbook, you’ll see a blank worksheet with three buttons.The first button opens the Windows-only UserForm shown in the first and second figures above, in the description of the problem.The second button opens the Windows-and-Mac UserForm shown in the third and fourth figures, in the description of the solution.The third button opens another Windows-and-Mac UserForm which also has a simple mechanism to call the ResizeUserForm procedure, and resize the UserForm on the fly. In Windows, this code is ignored, and the UserForm is displayed without rescaling.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.333333And this routine in a regular code module does the resizing: Sub ResizeUserForm(frm As Object, Optional dResizeFactor As Double = 0#)If dResizeFactor = 0 Then dResizeFactor = gUserFormResizeFactorFor iCol = LBound(vColWidths) To UBound(vColWidths)VColWidths(iCol) = Val(vColWidths(iCol)) * dResizeFactorI’ve posted a simple workbook that illustrates this technique. 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. Dropbox download for apple macOccasionally text wraps differently or certain other controls may need adjustments. Before deploying them to your users, you should make sure that the UserForms that look fine in Windows rescale properly on a Mac. Pretty large.If you enter 1 in the box, you can see how the form would look without resizing.In all of your real projects, you should apply this technique to all of your UserForms. Having a non-default background may help to avoid the problem.Here’s a real suggestion: When you load the UserForm, before you Show it, select a different page of the MultiPage, then select the page you want to open with. Point is, I haven’t noticed the issue you mention.I’ve also designed my UserForms to use a light blue background rather than the default muddy gray. I no longer support 2011, but I’m not going back to redesign my UserForms again to include MultiPages, though I may resume using them in new UserForms. So I designed all of my UserForms to use other approaches besides MultiPages (such as regular buttons that ran code to show and hide other controls). The Mac version was Excel 2011, and many of the UserForm controls looked awful, especially the MultiPage. ![]()
0 Comments
Leave a Reply. |
AuthorJohnny ArchivesCategories |