Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-11-25
4
Medium Priority
?
212 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 49

Accepted Solution

by:
Martin Liss earned 2000 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 49

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

730 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