User Form - Not Allowing Certain Cells to be Selected via TA

ElectricSkywalker

Board Regular
Joined
May 27, 2002
Messages
112
A question on user forms:

Is there a way when using a UserForm to stop a Text Box being selected when someone tabs through the form.

I have one text box that is Actual Data and the other text box is Budget data (which I have a lookup linked to). The Budget Data is for display purposes only).

I have worked out to Stop someone from entering data into the cell, but I have not worked out how to stop the text box being highlighted when I tab through. IS THIS POSSIBLE?

thank you
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
I'm not sure if this will solve the problem the way you want, but you can give it a shot.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim C As String
Dim R As String
C = "A"
R = "1"
Do Until R = "20"
If ActiveCell.Address = "$" & C & "$" & R Then
Range("B1").Activate
End If
R = Val(R) + 1
Loop
End Sub

This will keep anyone from selecting cells A1:A20

Does this help?
 
Upvote 0
Andrew,

I ended up going to Properties and finding:

Tab Stop = False

I also had a look at what you offered, being the Enable Function.

They both work....but whats the difference????
 
Upvote 0
The Enabled property specifies whether a control can receive the focus and respond to user-generated events. If False the user cannot interact with the control by using the mouse, keystrokes, accelerators, or hotkeys (including TAB).

The TabStop property indicates whether an object can receive focus when the user tabs to it. But if Enabled is True the user can still interact with the control eg by clicking it with the mouse.
 
Upvote 0

Forum statistics

Threads
1,214,648
Messages
6,120,726
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top