PDA

View Full Version : Lock TextBox From Selecting Or Copying Text But Allow Scroll



r_know
08-13-2016, 03:42 PM
Hi,

I've require solution to above subject line with and without VBA while working on TextBox inserted through developer.

Thanks
R_Know

1831

Excel Fox
08-13-2016, 08:48 PM
Can you please elaborate on what exactly are you hoping to do?

r_know
08-13-2016, 09:38 PM
attached file, having textbox which having text, it has to be read with scroll function in that textbox.
But user does not allowed to copy text from text box and does not allowed to delete TextBox.

r_know
08-14-2016, 11:42 PM
attached file, having textbox which having text, it has to be read with scroll function in that textbox.
But user does not allowed to copy text from text box and does not allowed to delete TextBox.









ANY SOLUTION PLS

Excel Fox
08-16-2016, 12:35 PM
Rudimentary. But adding this code seems to be working



Private Sub TextBox1_GotFocus()


ActiveCell.Select

End Sub

Admin
08-16-2016, 01:40 PM
Put this code in Sheet1 module.


Option Explicit
Dim ClipBoard As MSForms.DataObject

Private Sub TextBox1_GotFocus()

TextBox1.WordWrap = False
TextBox1.WordWrap = True

End Sub

Private Sub TextBox1_LostFocus()

Set ClipBoard = New MSForms.DataObject

'hope one of these will work :)
Application.CutCopyMode = False
ClipBoard.Clear
ClipBoard.SetText ""
ClipBoard.PutInClipboard

End Sub

r_know
08-17-2016, 03:24 AM
Thanks Admin
But It is allowing to copy from textbox, good thing only it wrap it...

Excel Fox
08-17-2016, 09:21 AM
Can you check the code I posted. Like I said, it is rudimentary, but seems to be working.

Admin
08-17-2016, 12:23 PM
Please check whether it allows to paste.