Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Scroll Bar in Text Box will not work

On Feb 10, 9:07*pm, Leith Ross
wrote:
;224184 Wrote:





On Feb 1, 12:37*am, " wrote:
I am not very familiar with text boxes, but I put a box on my
worksheet to try to teach myself how to use it. *I found I could

enter
text in the box, and use the WordWrap function ok.


Now I try to protect the worksheet, and I want the user to be able

to
see the text that I entered into the Text Box, but to not be able to
modify the text. *Thescrollbardoes not work. *Plus I cannot click
on it at all.


I need thescrollbarto view all of the text. *Am I on the right
track here? *What can I do to protect the dialog I have written in

thescrollbox, but to allow thescrollbarto work ok?


I managed to get it to work OK. *I no longer need help on this one (I
found out I was in the design mode). *I still do not know how to make
the scroll bar start at the top, though. *Note that the page is only
accessed through a macro, so macro code would work for me if I knew
how to code it.


HelloRJQMAN,

Here is macro to set the cursor back to the beginning of the text and
prevent the user from changing the or deleting any text in the control.
Change the name from "TextBox1" in the macro to your TextBox's name.
___________________________________________
Sub Macro1()

Dim TB As MSForms.TextBox

Set TB = ActiveSheet.OLEObjects("TextBox1").Object

With TB
.SelStart = 0 * *'Move the cursor to the begining of the text.
.Locked = True * 'Prevent user from changing or deleting text.
End With

End Sub
___________________________________________
Adding the Macro
1. Copy the macro above pressing the keys CTRL+C
2. Open your workbook
3. Press the keys ALT+F11 to open the Visual Basic Editor
4. Press the keys ALT+I to activate the Insert menu
5. Press M to insert a Standard Module into your VBA project
6. Paste the code by pressing the keys CTRL+V
7. Make any custom changes to the macro if needed at this time.
8. Save the Macro by pressing the keys CTRL+S * * *
9. Press the keys ALT+Q to exit the Editor, and return to Excel.

To Run the Macro...
To run the macro from Excel, open the workbook, and press ALT+F8 to
display the Run Macro Dialog. Double Click the macro's name to Run it.

--
Leith Ross

Sincerely,
Leith Ross

'The Code Cage' (http://www.thecodecage.com/)
------------------------------------------------------------------------
Leith Ross's Profile:http://www.thecodecage.com/forumz/member.php?userid=75
View this thread:http://www.thecodecage.com/forumz/sh...d.php?t=57169- Hide quoted text -

- Show quoted text -


Thanks for your help, Leith. My problem is now solved. I appreciate
your response very much.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Scroll wheel doesn't work in excel Ugla Excel Discussion (Misc queries) 7 June 19th 08 08:04 AM
My mouse scroll feature will not work in Excel 07 MUmfleet Excel Discussion (Misc queries) 1 January 2nd 08 10:20 PM
How to make Scroll Bar work on a form clara Excel Programming 2 March 23rd 07 04:43 PM
Can I get a scroll wheel to work in a list box ? RandyDtg1 Excel Programming 1 September 4th 04 11:18 PM
Mouse scroll wheel doesn't work in VBA Steve Brecher Excel Programming 2 April 17th 04 11:36 PM


All times are GMT +1. The time now is 08:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"