ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Text Box (https://www.excelbanter.com/excel-discussion-misc-queries/99908-text-box.html)

Skydiver

Text Box
 
I've inserted a textbox into a protected sheet. I have locked certain cells
within the sheet in which the user can tab their way through the form. In
order to type text into the textbox one has to click in it in order to begin
typing. Once finished you have to click out of the textbox then continue
tabbing their way through. Two questions. 1. Is there a way to tab into/out
of the textbox and begin typing within the textbox instead of having to click
in it? 2. Can I lock this textbox where one cannot move it around the
sheet/form?

Alan

Text Box
 

Skydiver wrote:

1. Is there a way to tab into/out of the textbox and begin typing within the
textbox instead of having to click in it?


You can activate a text box using a simple 1 line macro which can be
assigned to a button combination ...

ActiveSheet.Shapes("The Name of Your Text Box").Select

If unsure, just record a macro.

2. Can I lock this textbox where one cannot move it around the
sheet/form?


The answer to this may depend on the version of Excel you are using but
in v2003 it is possible to format the text box such that the box is
locked but not the text. When you then lock the worksheet you can write
in the box but not move it.


Skydiver

Text Box
 
Alan,

Thank you for your response. I am using Excel 2000. Regarding
question #1 I've never dealt with macros before. Can you carefully walk me
through this?

Skydiver

"Alan" wrote:


Skydiver wrote:

1. Is there a way to tab into/out of the textbox and begin typing within the
textbox instead of having to click in it?


You can activate a text box using a simple 1 line macro which can be
assigned to a button combination ...

ActiveSheet.Shapes("The Name of Your Text Box").Select

If unsure, just record a macro.

2. Can I lock this textbox where one cannot move it around the
sheet/form?


The answer to this may depend on the version of Excel you are using but
in v2003 it is possible to format the text box such that the box is
locked but not the text. When you then lock the worksheet you can write
in the box but not move it.



Alan

Text Box
 

Skydiver wrote:
Can you carefully walk me through this?


If you've never written a macro before the easiest way forward is to
use record.

Build your spreadsheet with a text box visible but make sure that it
isn't selected - have cell A1 selected or something - and then select
<Tools<Macro<Record New Macro from the menu. A box will appear that
enables you to 1. Name your macro (but no spaces are allowed) 2. Define
a short-cut key (Say Ctrl+z) to initiate the macro 3. Define where the
macro should be stored (within the existing workbook is probably the
best for you) and 4. A description of what the macro does if you feel
this is necessary. Click OK and a stop button should appear on your
screen for use at the end of the recording process.

Now enter the exact keystrokes or mouse clicks that you want the macro
to perform - in this case 1. select a cell that is very close to the
top LH corner of your text box and then 2. perform a single mouse click
within the text box - now click the stop button and your macro is
available for use by pressing Ctrl+z - from anywhere on that worksheet
just press Ctrl+z and type.

If you want to be able to do all of the above when you are starting on
a different sheet just begin your recording from a point on a different
sheet and the first step in the operation will be to select the correct
worksheet sheet prior to selecting a cell and clicking in the text box.

The macro you have recorded can be viewed or modified in the VBA editor
but without a basic understanding of VBA you may not wish to go there.

Cheers!


Alan

Text Box
 

Skydiver wrote:
Can you carefully walk me through this?


If you've never written a macro before the easiest way forward is to
use record.

Build your spreadsheet with a text box visible but make sure that it
isn't selected - have cell A1 selected or something - and then select
<Tools<Macro<Record New Macro from the menu. A box will appear that
enables you to 1. Name your macro (but no spaces are allowed) 2. Define
a short-cut key (Say Ctrl+z) to initiate the macro 3. Define where the
macro should be stored (within the existing workbook is probably the
best for you) and 4. A description of what the macro does if you feel
this is necessary. Click OK and a stop button should appear on your
screen for use at the end of the recording process.

Now enter the exact keystrokes or mouse clicks that you want the macro
to perform - in this case 1. select a cell that is very close to the
top LH corner of your text box and then 2. perform a single mouse click
within the text box - now click the stop button and your macro is
available for use by pressing Ctrl+z - from anywhere on that worksheet
just press Ctrl+z and type.

If you want to be able to do all of the above when you are starting on
a different sheet just begin your recording from a point on a different
sheet and the first step in the operation will be to select the correct
worksheet sheet prior to selecting a cell and clicking in the text box.

The macro you have recorded can be viewed or modified in the VBA editor
but without a basic understanding of VBA you may not wish to go there.

Cheers!



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com