Forum Discussion
Excel vba buttons disappearing
- Jan 04, 2023
Once I noticed that toggling between views made my buttons appear, I solved this problem by adding a page view instruction to a worksheet change code I was already running. If you aren't running a worksheet change code, you can still add one to target any cell(s) that user must change (in my case, user must input a number to proceed). If that's not an option, you can create a workbook open event that changes a cell (i.e. inserts date) 10 seconds after the workbook opens.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Application.EnableEvents = False
Dim rng As Range
Set rng = Range("A9:A10009")If Not Intersect(Target, rng) Is Nothing Then
Target.Value = UCase(Target.Value)
ActiveWorkbook.Save
ActiveWindow.View = xlPageLayoutView
End IfApplication.EnableEvents = True
End Sub
Once I noticed that toggling between views made my buttons appear, I solved this problem by adding a page view instruction to a worksheet change code I was already running. If you aren't running a worksheet change code, you can still add one to target any cell(s) that user must change (in my case, user must input a number to proceed). If that's not an option, you can create a workbook open event that changes a cell (i.e. inserts date) 10 seconds after the workbook opens.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Application.EnableEvents = False
Dim rng As Range
Set rng = Range("A9:A10009")
If Not Intersect(Target, rng) Is Nothing Then
Target.Value = UCase(Target.Value)
ActiveWorkbook.Save
ActiveWindow.View = xlPageLayoutView
End If
Application.EnableEvents = True
End Sub