» Determine the screen size using VBA in Microsoft Excel
VBA macro tip contributed by Erlandsen Data Consulting offering Microsoft Excel Application development, template customization, support and training solutions
CATEGORY - General Topics in VBA
VERSION - All Microsoft Excel Versions
Declare Function GetSystemMetrics32 Lib "User32" _
Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long
Sub DisplayMonitorInfo()
Dim w As Long, h As Long
w = GetSystemMetrics32(0) ' width in points
h = GetSystemMetrics32(1) ' height in points
MsgBox Format(w, "#,##0") & " x " & Format(h, "#,##0"), _
vbInformation, "Monitor Size (width x height)"
End Sub
Book Store:
Recommended Books:
- Special Edition Using Microsoft Access 2002
- F1 Get the Most out of Excel! The Ultimate Excel tip Help Guide
- Harry Potter and the Order of the Phoenix (Book 5)
- H&R Block's Just Plain Smart(tm) Tax Planning Advisor: A year-round approach to lowering your taxes this year, next year and beyond
- Financial Modeling - 2nd Edition
- Microsoft Excel VBA Programming for the Absolute Beginner
No comments have been submitted.

