Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Please forgive my posting this in two groups, but I have not had any
response in the Program group, and I need some help. I am trying to use a text box on a page (not on a User Form), and I have pre-loaded information in the box, so that it can be scrolled and viewed by the user. I would like to do the following, but do not know how to do it, or even if it is possible; 1) I would like to 'lock' the text so that the user cannot change it. 2) I would like the scroll bar to be at the top whenever the worksheet is accessed. The worksheet can only be accessed by a macro, so I could use code for one or both of these things, but I do not know how to approach it. I would really appreciate some help. Thanks in advance. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
In a standard module, paste :
Public Tb As String In the "ThisWorkbook" module, paste : Private Sub Workbook_Open() Tb = Sheets("Sheet1").TextBox1.Text End Sub This will serve to keep the initial value of the textbox. In the sheet module, paste : Private Sub TextBox1_Change() Me.TextBox1 = Tb End Sub This will restore the initial text each time it will be modified. Please note that the text is restored when the textbox loose the focus. Also, paste : Private Sub Worksheet_Activate() TextBox1.Activate TextBox1.CurLine = 1 Tb = TextBox1.Text End Sub to get the beginning of the text of the textbox when the sheet is selecteed. HTH Daniel Please forgive my posting this in two groups, but I have not had any response in the Program group, and I need some help. I am trying to use a text box on a page (not on a User Form), and I have pre-loaded information in the box, so that it can be scrolled and viewed by the user. I would like to do the following, but do not know how to do it, or even if it is possible; 1) I would like to 'lock' the text so that the user cannot change it. 2) I would like the scroll bar to be at the top whenever the worksheet is accessed. The worksheet can only be accessed by a macro, so I could use code for one or both of these things, but I do not know how to approach it. I would really appreciate some help. Thanks in advance. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Feb 11, 5:03*am, Daniel.C wrote:
In a standard module, paste : Public Tb As String In the "ThisWorkbook" module, paste : Private Sub Workbook_Open() Tb = Sheets("Sheet1").TextBox1.Text End Sub This will serve to keep the initial value of the textbox. In the sheet module, paste : Private Sub TextBox1_Change() * * Me.TextBox1 = Tb End Sub This will restore the initial text each time it will be modified. Please note that the text is restored when the textbox loose the focus. Also, paste : Private Sub Worksheet_Activate() * * TextBox1.Activate * * TextBox1.CurLine = 1 * * Tb = TextBox1.Text End Sub to get the beginning of the text of the textbox when the sheet is selecteed. HTH Daniel Please forgive my posting this in two groups, but I have not had any response in the Program group, and I need some help. I am trying to use a text box on a page (not on a User Form), and I have pre-loaded information in the box, so that it can be scrolled and viewed by the user. *I would like to do the following, but do not know how to do it, or even if it is possible; 1) I would like to 'lock' the text so that the user cannot change it. 2) I would like the scroll bar to be at the top whenever the worksheet is accessed. The worksheet can only be accessed by a macro, so I could use code for one or both of these things, but I do not know how to approach it. *I would really appreciate some help. *Thanks in advance.- Hide quoted text - - Show quoted text - Wow! Hello Daniel. Thanks so very much. It worked! FYI - I had to change the curline to "0" instead of "1"in order for the box to go to the very top line. Also as far as user changes, it worked even better than expected, because with the sheet protected, I found that the user cannot change the text at all. That is exactly what I wanted and what I had hoped for. Thanks again. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Scroll bar adding to text box | Excel Discussion (Misc queries) | |||
Tab and Scroll Question | Excel Discussion (Misc queries) | |||
Text Box w/Scroll Bar | Excel Discussion (Misc queries) | |||
Change scroll bar to end at end of text not bottom of worksheet?? | Excel Discussion (Misc queries) | |||
how do I create a "scroll box" for text in excel | Excel Discussion (Misc queries) |