right mouse click - cut copy paste in userform textboxes?

R

Roger on Excel

Is there a way to enable the right mouse click in userforms to allow cut copy
paste in text/combo boxes?

The default setting seems to have this option disabled??
Thanks,
Roger
 
R

Ryan H

I asked this forum and others if that could be done and no one seemed to know
if its possible. In the mean time I have been using

Ctrl + C to Copy
Ctrl + V to Paste

I guess you could possibly right some code in the Right Click Event that
would intialize a custom menu, but the trick would be how to access the
clipboard.

Hope this helps! If so, let me know, click "YES" below.
 
R

Ryan H

I have asked this question before in this forum and other forums, but with no
reply that I'm aware of. I have been using

Ctrl + C to Copy
Ctrl + V to Paste

There may be a way to put code into the Right Click Event that would
intialize a custom menu, but the trick would be accessing the clipboard. Not
sure if that is possible.
 
K

K_Macd

If you get off the ground with a rightclick menu the following clipboard
routines may be useful

Public Function TestClip() As Boolean

' Test for empty clipboard
Application.Volatile (True)

TestClip = IIf(Len(Trim(GetOffClipboard)) = 0, False, True)

End Function

Public Sub PutOnClipboard(Text As String)

Dim DataObj As New MSForms.DataObject ' REFERENCE SET IF INCLUDE DUMMY
USERFORM MODULE !
DataObj.SetText Text

DataObj.PutInClipboard
End Sub

Public Function GetOffClipboard() As String

' Extract text from clipboard
Application.Volatile (True)

Dim DataObj As New MSForms.DataObject
DataObj.GetFromClipboard

On Error GoTo ClipBError
GetOffClipboard = DataObj.GetText

Exit Function

ClipBError:
GetOffClipboard = ""

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top