Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Scroll wheel doesn't work in excel | Excel Discussion (Misc queries) | |||
My mouse scroll feature will not work in Excel 07 | Excel Discussion (Misc queries) | |||
How to make Scroll Bar work on a form | Excel Programming | |||
Can I get a scroll wheel to work in a list box ? | Excel Programming | |||
Mouse scroll wheel doesn't work in VBA | Excel Programming |