After running VBA my cells & font come back smaller and my mouse click is off by a couple cells

aaminchew

New Member
Joined
Dec 12, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have a workbook that I log monthly activity on within my office. There is a home screen with a button for each month. You click the button, and it runs the following VBA that opens selected month and hides all other sheets.
I have one for every month of the year, and each button is assigned to the perspective macro.

VBA Code:
Sub 
    ThisWorkbook.Unprotect Password:="5005"
    Sheets("Jan").Visible = True
    Sheets("Aaron's Home").Select
    Sheets("Jan").Select
    For Each sht In Sheets
    If sht.Name <> "Jan" Then
    sht.Visible = xlSheetHidden
    End If
    Next sht
    ThisWorkbook.Protect Password:="5005"
End Sub

I then have a button on each sheet that returns back to the home screen.

VBA Code:
Sub
    ThisWorkbook.Unprotect Password:="5005"
    Sheets("Aaron's Home").Visible = True
    Sheets("Jan").Select
    Sheets("Aaron's Home").Select
    For Each sht In Sheets
    If sht.Name <> "Aaron's Home" Then
    sht.Visible = xlSheetHidden
    End If
    Next sht
    ThisWorkbook.Protect Password:="5005"
End Sub

The buttons work, and they get me to the proper sheet.
The problem is that at random times, when I get to the selected sheet the font and cells are smaller and pixelated, and when I am trying to click a button, I have to click the cell that is down two and to the right one.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,214,606
Messages
6,120,487
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top