Right Click Cell to Show Text

Sharonca

New Member
Joined
Jan 9, 2022
Messages
16
Office Version
  1. 365
Platform
  1. Windows
Hello,
I have a protected sheet that has all formula columns set to locked & hidden. I would like to be able to show the text of the cells as the sheet is large and not all the text shows. I inserted an activeX text box and have the following code in the sheet. When I right click on a cell within the range designated the text box does not show. What am I doing wrong?

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("H:FC")) Is Nothing Then
Cancel = True
With TextBox1
.Visible = True
.Text = Target.Text
.Left = Target.Offset(, 1).Left
.Top = Target.Top
End With
Else
TextBox1.Visible = False
End If
End Sub

Thank you for your time and attention.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
It is a little confusing as to what cells you want to be able to click on. You start by saying that some columns are locked and hidden but it seems that your double click has nothing to do with that, since you can't double click a hidden cell. But if the cell is not hidden, then the user can see the content of the cell, so it's not clear why you need a textbox to show it.

At any rate, are the cells in H:FC locked? Does your protection mode specify that you can select unlocked cells and locked cells?

If your protection mode does not allow selection of these cells then you can't double click on them.

Here is a sample file based on what you described. The cells are locked but Select Unlocked Cells is selected for protection. A right-click will show the content in the textbox.

 
Upvote 0

Forum statistics

Threads
1,214,784
Messages
6,121,536
Members
449,037
Latest member
tmmotairi

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