Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Nov 2014
    Posts
    21
    Thanks
    16
    Thanked 1 Time in 1 Post

    Instructions for textboxes

    Hi,

    I have a spreadsheet that serves as a form with numerous textboxes that the user fills in. Due to limited space, the labels are inside the textbox as the default value which is overwritten by the user's entry. I would like to add some instructions on what to enter but I have no place to put them.

    Does anyone have any ideas how I can get users to input the correct data?

    Thank you
    Nicole

  2. #2
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,638
    Thanks
    115
    Thanked 650 Times in 592 Posts
    Nicole,

    How about something like a Mouseover message that appears like a comment to a cell. Using a rectangular shape formatted to the way you want with the desired text added, move it next to the textbox. Using the Selection Pane (Ribbon: Home > Find and Select), make it not visible. Place the following code in the sheets module. When you move the cursor over the text box, the message will appear the disappear when the cursor is moved off the text box.

    HTH
    Maud


    mouseover.png

    Code:
    Private Sub TextBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    If X > 5 And X < TextBox1.Width - 5 And Y > 5 And Y < TextBox1.Height - 5 Then
        ActiveSheet.Shapes.Range(Array("Rectangle 1")).Visible = True
    Else:
        ActiveSheet.Shapes.Range(Array("Rectangle 1")).Visible = False
    End If
    End Sub
    Attached Files Attached Files

  3. The Following User Says Thank You to Maudibe For This Useful Post:

    Nicole545 (2014-11-21)

  4. #3
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,638
    Thanks
    115
    Thanked 650 Times in 592 Posts
    Nicole,

    As an alternative, you could also use a mouseover to display a message in the status bar.

    Maud

    mouseover2.png

    Code:
    Private Sub TextBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    If X > 5 And X < TextBox1.Width - 5 And Y > 5 And Y < TextBox1.Height - 5 Then
        Application.StatusBar = "If the patient has a hyphenated last name, " & _
        "use only the name after the hyphen."
    Else:
        Application.StatusBar = ""
    End If
    End Sub

  5. The Following User Says Thank You to Maudibe For This Useful Post:

    Nicole545 (2014-11-21)

  6. #4
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,826
    Thanks
    136
    Thanked 482 Times in 459 Posts
    Hi Nicole

    If you used merged cells (with box outlines) for your spreadsheet 'form', then you can use data validation to display a message whenever the User clicks into that particular location. I prefer this to using cell comments, which could also be used to display a message.

    zeddy

  7. The Following User Says Thank You to zeddy For This Useful Post:

    Nicole545 (2014-11-21)

  8. #5
    New Lounger
    Join Date
    Nov 2014
    Posts
    21
    Thanks
    16
    Thanked 1 Time in 1 Post
    Zeddy,

    Thank you for your solution but I am using actual textboxes as a form. Something to keep in mind.

    Maubibe,

    I was attempting to put a cell comment in the cell beneath the textbox but it was not reliable that the person entering data on my form would pass over the cell. I was not aware you could create a mouse over effect with a text box. You learn something new every day. Both of your solutions are perfect but I prefer to use the one with the comment in a box.

    Thank you so much
    Nicole

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •