To show instructions to users in your Excel files, you can put notes in an Excel Userform, and add a Help button on each worksheet. The button will open the Help form to a specific page, and show the relevant Help information.
Download the sample file from my Contextures website:
[ Ссылка ]
===============
Video Transcript - Abridged
-----
If you create an Excel file for other people to use, you might want to leave some instructions for them. In this workbook, we have 3 sheets. Instead of putting notes on the sheets, put notes in a UserForm and add a Help button on each sheet to open that Help file if they'd like some assistance.
First, go to the Developer tab, click Visual Basic. That opens the Visual Basic Editor. Hhere we can see any workbooks that are open. And here's the one where I want to add the User Form for Help.
Make sure that file is selected and click Insert menu and UserForm. That gives us a blank User Form, named UserForm1. We'll call that Help Form. And caption it Help. Now, Help shows in that title bar.
We'd like this UserForm to show specific instructions for sheet the user has clicked the Help button on. Click title bar and in the toolbox this control is the multi page. Click it and draw a rectangle that almost fills this UserForm. I'd like a Help tab for each worksheet. I've got page 1, 2, and right click here, to add a new page.
So now there are 3 pages. When I click this one, it's just called Page1. I'm going to call that Order, so I'll call it pgOrders and make the caption Orders. That will be the Help for that sheet. This one right now it's Page2. It will be pgPivot and the caption will be Pivot. And for the third one, it's pgList and the caption will be List. I'll have an S on that as well.
Going back to the workbook, here's the orders sheet. I'm just going to select all that and press Ctrl C to copy. Then go back to Visual Basic and on this Orders tab, we're going to put in a label. So click Label. Just draw another rectangle to fill that space. I'll click within it, highlight that existing text, Control V to paste.
Then I'm going to do the same thing for the pivot. Just go here, highlight that and copy it. Put it in another label and paste and the same for the list. Go to the prices where the list of prices is, copy that and in here, add a final label and paste. So now each tab is set up with specific Help for that worksheet.
When we click on Orders, it used to say Page1 but if we look in the properties, we can see its index is zero, so the numbering starts at zero. So this will be page zero, one, and two. So we want to get to the right page when this Help UserForm opens. So to do that, we're going to create three macros that will open the right page. To store the macros, I'm going to insert a module.
Now on top of the module, I'll create a public variable called iPage and this will be as an integer. That's just going to store those page numbers and a little sub Help0 and this will set the iPage equals zero. Our UserForm, we can see here, is HelpForm, HelpForm show. When we use that macro, it's going to open the first page. I'll just Ctrl C to copy that and Ctrl V to paste it twice. This will be 1 to show page one, 2, to show page two.
Now going back to the UserForm, we're going to right click on it and click View Code, creates this UserForm click event, which I don't want to use. So I'm going to select initialize instead and I can delete this click event. So within here when this form is initialized, I want it to Me, which is the UserForm.
Multipage is the name of that multipage control. Just press the Tab key to select that, then dot value equals, we want it to use that iPage value, so when it opens, it's going to go to whatever page our macro told that the iPage value is.
Now back into the workbook, we'll go to the orders sheet and on the Developer tab, we're going to insert a button and just at the top of the sheet, this one will use Help0. Click OK. Instead of it saying Button 1, we'll put Help. When I click it now, it opens the Help at the first page, which is page zero. I'm going to copy that. Go back to the next sheet and Ctrl V to paste it, right click and click Assign Macro and this will be Help1 and click OK. On the Prices. We'll paste again, right click, assign macro, and this is Help2, OK, and then just click away from the button on each sheet so it's not selected.
Now if I click Help here, we're on the first tab. On the pivot sales, if I click Help, it goes to the second tab and from prices, click Help and it goes to the third. So it opens the Help at the applicable Help screen, but you can go back and look at the others. So if someone wants to look at all the help while they're in here, they can, but it takes them immediately to the most important help for the page that they're on. To close it, just click X and you're back in the workbook.
Ещё видео!