userform

How to have msgbox appear when cell value hasn't changed in 30secs or 1min etc

允我心安 提交于 2020-07-23 06:37:16
问题 I am trying to make a msgbox appear when a cell value in range B4:B160 hasn't changed in 30secs or 1min etc. So what will appear is something like 'Have you scanned?' and will only appear if they haven't entered data in that cell in 30secs but will also close itself after 6mins or when they do enter data. It would be great if i can adjust these times in the code. My spreadsheet is used for barcode scanning and is currently already running a userform when they enter the wrong data. Can I add

How to have msgbox appear when cell value hasn't changed in 30secs or 1min etc

萝らか妹 提交于 2020-07-23 06:35:41
问题 I am trying to make a msgbox appear when a cell value in range B4:B160 hasn't changed in 30secs or 1min etc. So what will appear is something like 'Have you scanned?' and will only appear if they haven't entered data in that cell in 30secs but will also close itself after 6mins or when they do enter data. It would be great if i can adjust these times in the code. My spreadsheet is used for barcode scanning and is currently already running a userform when they enter the wrong data. Can I add

How to detect if a specific key was pressed?

≡放荡痞女 提交于 2020-07-20 17:28:52
问题 I'm wondering is there a way to detect if a specific key (like backspace) was pressed. This is what I'm shooting for: Private Sub SomeTextBox_Change() If len(Me.SomeTextBox.Value) = 3 and KEYPRESSED is NOT BACKSPACE Then <.......Code Here> Else <.......Code Here> End if End Sub 回答1: You should use KeyPress event instead of Change event: Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) If Len(Me.SomeTextBox.Value) = 3 And KeyAscii <> 8 Then 'Backspace has keycode = 8. <..

How to detect if a specific key was pressed?

烈酒焚心 提交于 2020-07-20 17:27:20
问题 I'm wondering is there a way to detect if a specific key (like backspace) was pressed. This is what I'm shooting for: Private Sub SomeTextBox_Change() If len(Me.SomeTextBox.Value) = 3 and KEYPRESSED is NOT BACKSPACE Then <.......Code Here> Else <.......Code Here> End if End Sub 回答1: You should use KeyPress event instead of Change event: Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) If Len(Me.SomeTextBox.Value) = 3 And KeyAscii <> 8 Then 'Backspace has keycode = 8. <..

Unable to capture AfterUpdate event with a custom event handler

和自甴很熟 提交于 2020-07-19 06:41:37
问题 I have a Userform with several TextBox , and I need to check their values so I have created a single event handler using a class module with a WithEvent private object. The Change event handler works just fine, but not the AfterUpdate handler (the same goes for BeforeEvent , Enter , Exit ). Here's a short example of the problem: ' class name is NumberBox Private WithEvents nbTextBox As MSForms.TextBox Public Property Set TextBox(ByVal t As MSForms.TextBox) Set nbTextBox = t End Property

How to add multiple data rows at once from UserForm to Excel DataBase

我只是一个虾纸丫 提交于 2020-07-09 06:11:15
问题 I'm making some sort of football database where I would input data using a userform and where I want to retrieve data from my excel database. I have a worksheet named: "wedstrijden" This worksheet contain the columns: Date, HomeTeam, AwayTeam, HomeScore,AwayScore, HomeOdds and AwayOdds My other worksheet is named: "ingevenuitslagen" This worksheet contains my userform called UitslagenIngeven Using the code below I'm able to input my data from the userform to my "wedstrijden" worksheet Private

How to add multiple data rows at once from UserForm to Excel DataBase

你。 提交于 2020-07-09 06:10:10
问题 I'm making some sort of football database where I would input data using a userform and where I want to retrieve data from my excel database. I have a worksheet named: "wedstrijden" This worksheet contain the columns: Date, HomeTeam, AwayTeam, HomeScore,AwayScore, HomeOdds and AwayOdds My other worksheet is named: "ingevenuitslagen" This worksheet contains my userform called UitslagenIngeven Using the code below I'm able to input my data from the userform to my "wedstrijden" worksheet Private

Copy userform to another workbook

纵然是瞬间 提交于 2020-07-07 10:41:42
问题 I've had a look for an answer to this question but can't find anything that matches exactly what I'm looking for, if someone has the answer or can point me in the direction of a question which answers this, it would be much appreciated. I've been talked with building a solution to enter data into a workbook and have successfully built it, however the workbook it need to be added to is a very active tool and is constantly being updated with new/changed data, so I have had to build it in a copy

VBA: Can't change Image Control picture after click on element

。_饼干妹妹 提交于 2020-06-27 15:41:13
问题 Setup I have an Excel VBA UserForm with an Image Control element. When clicking on buttons in the form, the Image Control's Picture source is set / updated with the following code: Set MyForm.imgControl.Picture = LoadPicture(pathToFile) Problem When the user clicks on the Image Control, updating its Picture source doesn't work anymore. The problem occurs, no matter when in the workflow the Image Control is clicked: Example 1: User clicks a button to set the Picture (and pictures sets

VBA- Using RefEdit for copying range between workbooks

你说的曾经没有我的故事 提交于 2020-06-17 07:18:29
问题 I wanted to copy some not continous ranges from several workbook/ worksheets to a specific sheet. I am using a userform and RefEdit control on that. But the Excel freezs each time I am calling the form and addressing the ranges! I can't do anything except End Excel! Here is my Code. Private Sub CommandButton1_Click() Dim rng As Range Set rng = Range(Me.RefEdit1.Value) rng.Copy ThisWorkbook.Sheets("Transfer").Range("a1").PasteSpecial xlPasteValues End Sub Private Sub UserForm_Activate() For