ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Text Box has the focus (https://www.excelbanter.com/excel-programming/326587-text-box-has-focus.html)

Spencer Hutton

Text Box has the focus
 
i have a form with several text boxes on it. let's just say TextBox1 through
TextBox5. i have Label1, which i wish to display a short help message when
that textbox has the focus. the help statements are in range A1:A5. how can
i translate this message into VBA:
if TextBox1 has the focus then Label1.Caption = range("A1").Value

TIA

JulieD

Text Box has the focus
 
Hi Spencer

use the textbox1_Enter event e.g.

Private Sub TextBox1_Enter()
Label1.Caption = Range("A1").Value
End Sub

if you want to clear the caption put code also against the Textbox1_Exit()

Cheers
JulieD

"Spencer Hutton" wrote in message
...
i have a form with several text boxes on it. let's just say TextBox1
through
TextBox5. i have Label1, which i wish to display a short help message
when
that textbox has the focus. the help statements are in range A1:A5. how
can
i translate this message into VBA:
if TextBox1 has the focus then Label1.Caption = range("A1").Value

TIA





All times are GMT +1. The time now is 03:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com