View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
TimT TimT is offline
external usenet poster
 
Posts: 69
Default Userform - Move to next textbox field by hitting enter instead

Ya killin me bro.... I just finished.
But I still have 6 more forms to do and that will help me tremendeously
(friggin spelling..)
Thanks again!


"Harald Staff" wrote:

OK, ok, ok, ok. I surrender.

Replace "Userform1" wit the name of your particular form and this little
etude will generate all the necessary code for you in the immediate window:

Sub test()
Dim C As MSForms.Control
For Each C In UserForm1.Controls
If TypeOf C Is MSForms.TextBox Then

Debug.Print "Private Sub " & C.Name & "_KeyDown(ByVal KeyCode As _"
Debug.Print "MSForms.ReturnInteger, ByVal Shift As Integer)"
Debug.Print "If KeyCode = 13 Then KeyCode = 9"
Debug.Print "End Sub"
Debug.Print ""

End If
Next
End Sub

HTH. Best wishes Harald

"TimT" skrev i melding
...
Harald,
I just realized, I know what I needed to ask you...
Is there any way that I could simply pull up a list of all the
textboxes/objects on a particular form that I am working on?

example: if I'm replacing all the "Textbox_1"'s... that's about 83 of
them
I have to do and even though I used a consistant naming convention I can't
remember them all.

Solution?

"Harald Staff" wrote:

Glad to hear that. Thank you for the feedback.

Besst wishes Harald

"TimT" skrev i melding
...
Brilliant Harald!
Thank you so much.
You are absolutely right, it's not that bad and it makes me feel alot
better
about myself knowing I can provide what the user is looking for.

Much thanks brah.

TTeska
Tax Technology
Marcum & Kliegman LLP
Melville, NY 631.414.4594