From: Bobby on
Hi,
Could someone tell how to initialize or place the cursor in a specific
box on a userform, when I open the userform containing 4 text boxes.
By default it goes in the first one.

Thank's ahead.
From: Rick Rothstein on
Just use the TextBox's SetFocus method. For example, if you wanted TextBox3
to have focus...

Private Sub UserForm_Initialize()
TextBox3.SetFocus
End Sub

--
Rick (MVP - Excel)



"Bobby" <rpqcca(a)gmail.com> wrote in message
news:4e7f11ee-1788-4bc5-8bc3-5c2be8e54ef0(a)q8g2000vbm.googlegroups.com...
> Hi,
> Could someone tell how to initialize or place the cursor in a specific
> box on a userform, when I open the userform containing 4 text boxes.
> By default it goes in the first one.
>
> Thank's ahead.

From: Bobby on
On Apr 28, 3:00 pm, "Rick Rothstein"
<rick.newsNO.S...(a)NO.SPAMverizon.net> wrote:
> Just use the TextBox's SetFocus method. For example, if you wanted TextBox3
> to have focus...
>
> Private Sub UserForm_Initialize()
>   TextBox3.SetFocus
> End Sub
>
> --
> Rick (MVP - Excel)
>
> "Bobby" <rpq...(a)gmail.com> wrote in message
>
> news:4e7f11ee-1788-4bc5-8bc3-5c2be8e54ef0(a)q8g2000vbm.googlegroups.com...
>
>
>
> > Hi,
> > Could someone tell how to initialize or place the cursor in a specific
> > box on a userform, when I open the userform containing 4 text boxes.
> > By default it goes in the first one.
>
> > Thank's ahead.- Hide quoted text -
>
> - Show quoted text -

Great! Thank's

How can I get the info selected after having the cursor in that
specific box,so when I start typing the new number is written?
Thank.
From: Rick Rothstein on
>> > Could someone tell how to initialize or place the cursor in a specific
>> > box on a userform, when I open the userform containing 4 text boxes.
>> > By default it goes in the first one.
>>
>> Just use the TextBox's SetFocus method. For example, if you wanted
>> TextBox3
>> to have focus...
>>
>> Private Sub UserForm_Initialize()
>> TextBox3.SetFocus
>> End Sub
>
> Great! Thank's

First off, it is always a good idea to post in the same way as the person
who responded to you (that is, keep posting all new responses to the top or
bottom, but alternate between the top and the bottom as you did)... it keeps
the flow of responses in an easy to follow order so people viewing the
thread in the future can follow it more easily). I have repaired this
message to bottom post to match your response, but in the future, it would
be a better idea for you to adopt the method used by the person who
responded to you....

> How can I get the info selected after having the cursor in that
> specific box,so when I start typing the new number is written?

So the new number is written **where**... to a Label on the UserForm, a cell
in the worksheet, somewhere else? The code depends on how you want the user
to interact with the UserForm. Are you just going to dump whatever the user
types directly into wherever you want to display it at? Are you going to
validate the entry first (if you are looking for a number and the user types
"ABC", how are you going to handle that)? Are you going to use an OK button
to signal that it is time to put the text wherever it will finally be
placed... or will just the action of moving the focus to another control or
closing the UserForm be the action that initiates the moving of the text to
wherever it will finally be placed? When you work in the VB world, there is
lots more to consider and control... you kind of have to have an overall
idea what you want to do and how you want to do it or you will be tearing
apart and rebuilding code all over the place.

--
Rick (MVP - Excel)



From: Mike on
TRY THIS
Private Sub UserForm_Initialize()
TextBox3.SetFocus
End Sub

"Bobby" wrote:

> Hi,
> Could someone tell how to initialize or place the cursor in a specific
> box on a userform, when I open the userform containing 4 text boxes.
> By default it goes in the first one.
>
> Thank's ahead.
> .
>