How do I add my own help screens

KentBurel

Board Regular
Joined
Mar 27, 2020
Messages
68
Office Version
  1. 2019
Platform
  1. Windows
I'm writing a workbook that generates worksheets dynamically. I want to be able to display help information to users that might need it. I tried creating a userform and then adding a text box to the form but it won't let me enter multiple lines of text. It ignores the enter key. I tried it with a label control as well. I have added an instructional comment to the A1 cell on the sheet but I'm afraid that the user will miss the comment indicator. How do I present a page of text to the user in a window that the user can close when they like?
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Did you set the MultiLine property of the TextBox to True.
If you want the Enter key to send the focus to the next control on the userform, set the .EnterKeyBehaviour property to False.
If you want the Enter key to enter a linefeed into the text being entered, set the .EnterKeyBehaviour to True.

If you just want to present a page of text to the user. A userform with Label would be a good choice.
 
Upvote 0
1588021159143.png
 
Upvote 0
That should let the user type into the TextBox, but for your purpose you don't need that capability. The user won't be making any data entry.

What happens when you (temporarily) add a command button to your form with this code?
VBA Code:
Private Sub CommandButton1_Click()
    Dim myString As String
    
    myString = "First Line"
    myString = myString & vbCr & "Second line"
    myString = myString & vbCr & "<blank line>"
    myString = myString & vbCr & "Last Line"
    
    TextBox1.Text = myString
    
End Sub
 
Upvote 0
Thank you for your help. It works. I display the userform when the appropriate sheet is first activated. While that sheet is active I use the application.onkey method to remap F1 to show my UserForm. It’s all working.

When I was researching onkey, I discovered Application.Help. Where can I find instructions about writing my own help files?

I’m disappointed with the book I’m using to learn VBA. I’m discovering many topics that are not covered in the book. The cause of this thread is that I have no documentation on the properties of userforms. I’m old school. I learn better using paper books. I’d appreciate a recommendation for better books to lea by.

Thank you.
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,303
Members
449,078
Latest member
nonnakkong

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