PDA

View Full Version : [SOLVED:] Move Cursor in Text Box



mpewsey
09-16-2005, 02:03 AM
Hi there.

I've been a lurker on the site for some time now & have always been able to find the answer to my problems here whilst teaching myself VBA.

However, I've come across something that I can't find an answer to - hopefully one of you can help me.

I've created a user form which contains a text box which, when initialized, can potentially contain a lot of text taken from various cells in the spreadsheet.

I've multi-lined the text box & added a scroll bar but, when the user form is shown, the cursor is always at the end of the text & you have to scroll up to see the beginning.

Is there a way to put the cursor at the beginning of the text?

Thanks for your assistance.

Killian
09-16-2005, 02:48 AM
Hi and welcome to VBAX :hi:

It's always gratifying to convert a lurker and happily I have an answer for you. :yes
After you filled the textbox, you can set the cursor line to 0


Me.TextBox1.CurLine = 0
That should do the trick

Hope to hear from you soon

mpewsey
09-16-2005, 03:11 AM
Many thanks for the quick reply. - I knew that there must be a simple way of doing it.