Daniel2022
New Member
- Joined
- Feb 20, 2022
- Messages
- 3
- Office Version
- 2019
- Platform
- Windows
Hi there. I'm a fairly new in VBA but things used to go well until this moment.
My co-workers use Excel that consist 50 different sheets while this amount rises every month. I managed to create module that creates new sheet with desirable template but I also want to create button that opens and hides required sheet. My idea is to insert InputBox where a person puts sheet' name.
However, I right now I faced an issue that I cannot create similar macros to view and hide sheet in accordance to its name.
I also attach the screenshot how "create" button looks and what it shows and code:
Any help/ ideas how to do it will be valuable.
Thank you,
Kind Regards,
Daniel
My co-workers use Excel that consist 50 different sheets while this amount rises every month. I managed to create module that creates new sheet with desirable template but I also want to create button that opens and hides required sheet. My idea is to insert InputBox where a person puts sheet' name.
However, I right now I faced an issue that I cannot create similar macros to view and hide sheet in accordance to its name.
I also attach the screenshot how "create" button looks and what it shows and code:
VBA Code:
Sub NewSheet()
Dim s As String
s = InputBox("Please write month and year e.g September 2021")
If s = "" Then Exit Sub
Sheets("Macro").Copy , Sheets(Sheets.Count)
With ActiveSheet
.Name = s
End With
End Sub
Any help/ ideas how to do it will be valuable.
Thank you,
Kind Regards,
Daniel