Solved

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

Posted on 2013-11-25
4
210 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 47

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 47

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Additional Controls in Excel VBA Does Not Show Anything 5 24
Excel - IF criterion 2 24
Unique List in UserForm 3 26
Day Count issue - Days360? 12 30
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

752 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