I need help with vba codes that are not working properly. I have three worksheets in a workbook namely:
Income & Expenditure
On the ‘Menu’ sheet I created a textbox button each for the other two sheets including one button for ‘Exit’:
My aim is this: When the ‘Main Menu’ sheet is showing and I click on the button for e.g. ‘Balance Sheet’, it would take me to the ‘Balance Sheet’ sheet and hide the other sheets (i.e. the ‘Menu’ and the ‘Income & Expenditure’ sheets.
On the ‘Balance Sheet’ sheet, I have a button for ‘Menu’, and when I click the button, it should take me back to the ‘Menu’ sheet and hide the other sheet including the ‘Balance Sheet’ Sheet itself.
On the Menu sheet, I created textbox buttons and assigned macros to take me to the those other sheets. And on each of those other sheets I created a ‘Menu’ button to take me back to the Menu. For e.g. on the ‘Balance Sheet’ sheet, I placed the following codes:
The first code takes me from the Menu to the Balance Sheet – hiding the Income & Expenditure Sheet but it DOES NOT HIDE the Menu sheet itself. However, the second code takes me from the ‘Balance Sheet’ back to the Menu. In this case it succeeds in hiding itself (the Balance Sheet ) and also the Income & Expenditure Sheet.
I also placed two such codes on the ‘Income & Expenditure’ Sheet and I get the same result.
My problem here is that I am unable to figure out the appropriate code to place in the Menu sheet or to attach to any of those other codes to achieve the ‘hiding’ of the Menu sheet. For e.g. When I click on the button for ‘Balance Sheet’ it should take me to the Balance Sheet while hiding both the Menu sheet and the Income & Expenditure sheet. The second part of it is OK i.e. when I am on the Balance Sheet and click on the Menu button, it takes me back to the Menu and successfully hides the other sheets.
Can someone help me please.
PS: It is possible I might have messed things up a bit by creating the Menu buttons using textbox buttons and the sheet buttons using command buttons. It is too late for me to scrap them and start all over. They work partially. All that I want is a tweaking of the codes so that when I go from the Menu, that particular sheet should be hidden along with the other sheet that I am not going to.