Userform example for a help file in the Excel workbook.

FryGirl

Well-known Member
Joined
Nov 11, 2008
Messages
1,368
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Does anybody have a sample they can point me to which has an help UserForm to display to user to give them help on certain attributes of a spreadsheet?

I found this one on contextures, but it's a multi form and I'm thinking more like a dropdown box with choices. Anybody know where to find a good example?

https://www.contextures.com/excelfiles.html
UF0014 - MultiPage Excel UserForm
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
So are you wanting to select a value in a Combobox like Shortcut
And then a form would display instructions on how to use shortcut keys or something like that?

If your familiar with Multipages we could write a script where when you select Shortcut from a combobox then a Multipage would popup displaying what you wanted about shortcuts. Would something like that work.
 
Upvote 0
So do you have your Userform built with all your Multipage1 Pages ?

If not you will have to do that part and have a Combobox on the Userform where we can load in the Multipage1 Page names.

The multipage names should have some logic.

Like for example if you were dealing with subjects

Math English Science


And you would need a Combobox and a Command button

You would choose from the combobox the name of the Multipage1 page name
Then click on a command button to run the script.

All the other Multipage1 pages would be hidden and on the Multipage1 page you would enter a Label with the Text you want the user to see.

Do you understand all this and the logic?

If you have all this done.

Give ne the names of the Multipage1 page names
Give me The combobox name
Give me the name of your command button
 
Upvote 0
No I do not have those things yet, but that part I can put together. Can we just give generic names to those controls and then I will name to match?
 
Upvote 0
Well here is the code I used.

You will have to modify to your needs.
I prefer to know details first. But if you think you can sort it out here it is:
I never like putting the Cart before the Horse.

Code:
Private Sub CommandButton1_Click()
Dim ans As String
ans = ComboBox1.Value
 
For Each Page In MultiPage1.Pages
    If Page.Caption <> ans Then
        Page.Visible = False
    Else
        Page.Visible = True
        MultiPage1.Value = 1
    End If
Next
End Sub
Private Sub UserForm_Initialize()
 For Each Page In MultiPage1.Pages
    ComboBox1.AddItem Page.Caption
 Next
End Sub
 
Upvote 0
Got it all setup. This is perfect thanks. Instead of the cmd btn, I attached the code to the change of the combobox.

Since I have Option Explicit at the top of the module, how do I define the variable Page?
 
Upvote 0
I really do not know.
I never use Option Explicit

I wrote the code my way and it works. Now if you want to write the code your way I'm not sure how to do it.
 
Upvote 0
Not sure about if this is proper but it works for me:
I set page to object

Code:
Option Explicit
Private Sub ComboBox1_Change()
Dim ans As String
Dim Page As Object
ans = ComboBox1.Value
 
For Each Page In MultiPage1.Pages
    If Page.Caption <> ans Then
        Page.Visible = False
    Else
        Page.Visible = True
        MultiPage1.Value = 1
    End If
Next
End Sub
Private Sub UserForm_Initialize()
Dim Page As Object
 For Each Page In MultiPage1.Pages
    ComboBox1.AddItem Page.Caption
 Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,752
Messages
6,180,742
Members
452,996
Latest member
nelsonsix66

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