Glad to help. Here's a before workbook close macro to add to the ThisWorkbook object:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call ResetScreenResolution
End Sub
Then add this to your current module:
Sub ResetScreenResolution(Optional Dummy As Integer)
Dim x As Long
Dim y As Long
Dim MyMessage As String
Dim MyResponse As VbMsgBoxResult
x = Sheets("Sheet3").Range("A1").Value
y = Sheets("Sheet3").Range("A2").Value
MyMessage = "Your current screen resolution is " & x & " X " & y & vbCrLf _
& vbCrLf & "Would you like to change your screen resolution now (you can change it back later, if you wish)?"
MyResponse = MsgBox(MyMessage, vbExclamation + vbYesNo, "Screen Resolution")
If MyResponse = vbYes Then
Sheets("Sheet3").Range("A1").FormulaR1C1 = x
Sheets("Sheet3").Range("A2").FormulaR1C1 = y
Call Shell("rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,3")
End If
End Sub
Also, if that did the trick for you, please consider marking this thread solved:
To mark your thread solved do the following:
- Go to the first post
- Click edit
- Click Advance
- Just below the word "Title:" you will see a dropdown with the word No prefix.
- Change to Solve
- Click Save
If you're so inclined, you could also add to my reputation by clicking the scales to the right of my user name 
Tom
Bookmarks