Couple of alternatives, depending on exactly what you are after:
There is a userform mouse_down event and the x and y values give you
the position of the cursor on the userform. Run this and see what happens...
'---
Private Sub UserForm_MouseDown(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
MsgBox "Button = " & Button & Chr$(13) & _
End Sub
'---
'Or you could just have one DataObject code sub and
'call it from each textbox mouse down event:
'---
'Code similar to this for each textbox...
Private Sub TextBox1_MouseDown(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Dim strReturn As String
Call GetMeTheData(strReturn)
TextBox1.Value = strReturn
End Sub
'Just one instance of this code...
Private Sub GetMeTheData(ByRef sCode As String)
Dim doclip As DataObject
Set doclip = New DataObject
doclip.GetFromClipboard
sCode = doclip.GetText
sCode = Replace$(sCode, Chr$(145), Chr$(39))
sCode = Replace$(sCode, Chr$(147), Chr$(34))
sCode = Replace$(sCode, Chr$(148), Chr$(34))
doclip.SetText sCode
doclip.PutInClipboard
sCode = doclip.GetText
Set doclip = Nothing
End Sub
'---
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(XL Companion add-in: compares, matches, counts, lists, finds, deletes...)