Scroll Bar in Text Box will not work

R

RJQMAN

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. The scroll bar does not work. Plus I cannot click
on it at all.

I need the scroll bar to view all of the text. Am I on the right
track here? What can I do to protect the dialog I have written in the
scroll box, but to allow the scroll bar to work ok?
 
R

RJQMAN

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.
 
L

Leith Ross

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.

Hello RJQMAN,

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/)
 
R

RJQMAN

(e-mail address removed);224184 Wrote:







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/showthread.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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top