Solved

Typing in a cell as opposed to any other way a textbox can get its value

Posted on 2013-11-25
4
211 Views
Last Modified: 2013-11-26
Excel 2010
vba
useform and textbox

I need to know if there a way to capture distinctly if a person is actually typing a value in a textbox on a userform as opposed to ANY other way a textbox can get it value?



Thanks
fordraiders
0
Comment
Question by:fordraiders
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 48

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 39676301
You can probably do this.

Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If (KeyCode = 17 And Shift = 2) Or (KeyCode = 86 And Shift = 2) Then
    ' copying or pasting
Else
    MsgBox "Manual update"
End If
End Sub

Open in new window

0
 
LVL 3

Author Closing Comment

by:fordraiders
ID: 39676720
Thanks...
0
 
LVL 3

Author Comment

by:fordraiders
ID: 39676721
forget to ask...  cut and paste ?
0
 
LVL 48

Expert Comment

by:Martin Liss
ID: 39677852
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)

If (KeyCode = 17 And Shift = 2) Or _
   (KeyCode = 86 And Shift = 2) Or _
   (KeyCode = 88 And Shift = 2) Then
    ' copying or pasting
Else
    MsgBox "Manual update"
End If
End Sub

Open in new window

You're welcome and I'm glad I was able to help.

Marty - MVP 2009 to 2013
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question