ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   getting the cursor to show in a textbox (https://www.excelbanter.com/excel-programming/302026-getting-cursor-show-textbox.html)

Simon Lloyd[_495_]

getting the cursor to show in a textbox
 
Hi all,

I have created a userform to act as a password input box and if th
password is a match then do a couple of things...which it does quit
happily.....but next time the tool bar button is clicked to which
assigned the macro the userform pops up the Textbox has no curso
flashing in it so you have to have another mouse click to select th
box before typing the password.

Anyone know how to get the cursor blinking in the textbox each time it
opened?

Here's some snippets of code:-

Sub Admin()
'
' Admin Macro
' Macro recorded 21/06/2004 by Simon
'

'
UserForm2.Show
End Sub

Private Sub CommandButton1_Click()

UserForm2.Hide
TextBox1.Text = ""
End Sub

Private Sub TextBox1_Change()
If TextBox1.Text = "pass" Then
Application.CommandBars.ActiveMenuBar.Enabled = True
Worksheets("Hidden").Visible = True
ElseIf TextBox1.Text < "pass" Then
Exit Sub

End If
Me.Hide
End Su

--
Message posted from http://www.ExcelForum.com


Tom Ogilvy

getting the cursor to show in a textbox
 
Private Sub CommandButton1_Click()

UserForm2.Hide
TextBox1.Text = ""
Textbox1.Setfocus
End Sub

might work.

--
Regards,
Tom Ogilvy

"Simon Lloyd " wrote in message
...
Hi all,

I have created a userform to act as a password input box and if the
password is a match then do a couple of things...which it does quite
happily.....but next time the tool bar button is clicked to which i
assigned the macro the userform pops up the Textbox has no cursor
flashing in it so you have to have another mouse click to select the
box before typing the password.

Anyone know how to get the cursor blinking in the textbox each time its
opened?

Here's some snippets of code:-

Sub Admin()
'
' Admin Macro
' Macro recorded 21/06/2004 by Simon
'

'
UserForm2.Show
End Sub

Private Sub CommandButton1_Click()

UserForm2.Hide
TextBox1.Text = ""
End Sub

Private Sub TextBox1_Change()
If TextBox1.Text = "pass" Then
Application.CommandBars.ActiveMenuBar.Enabled = True
Worksheets("Hidden").Visible = True
ElseIf TextBox1.Text < "pass" Then
Exit Sub

End If
Me.Hide
End Sub


---
Message posted from http://www.ExcelForum.com/




Simon Lloyd[_497_]

getting the cursor to show in a textbox
 
Thanks Tom worked a treat!!!!

Simo

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 07:12 AM.

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