Auto click "Submit" or "OK" button

Ramiel

New Member
Joined
Mar 29, 2017
Messages
2
Hello,

Good day everyone.

I need help on excel vba. A small excel vba application was created to capture the In/Out of equipments with the use of colleagues ID.

Is there a way that will automatically click the "Submit" button or click spacebar without using the mouse or keyboard?

Thanks.


1605452920581.png
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
What action do you want to cause the click to happen? The reason this dialog has a Submit button is that only the user knows when both fields have been completely typed.
 
Upvote 0
User will just scan their ID with password and that's it. No confirmation is required.

Below is the code;

Private Sub CommandButton1_Click()

If TextBox1.Value = "" Then
TextBox1.BackColor = vbRed
MsgBox ("Equipment number is required. Please scan the equipment barcode")

Call resetForm

End If

If TextBox2.Value = "" Then
TextBox2.BackColor = vbRed
MsgBox ("You Login ID is required. Please scan your ID to proceed")

Call resetForm

End If


ActiveCell = TextBox1.Value
ActiveCell.Offset(0, 1) = TextBox2.Value
ActiveCell.Offset(0, 2) = TextBox3.Value

ActiveCell.Offset(1, 0).Select
Call resetForm


End Sub
 
Upvote 0
There is a lot of information missing in your description. Your first post did not mention scanning of anything. The code refers to a equipment number, not shown in your first post. The code also refers to a user ID, but there is no reference in the code to a password so my first post still stands. If the user is typing the password you have to have a way for the user to indicate they have completed typing.
 
Upvote 0

Forum statistics

Threads
1,213,534
Messages
6,114,188
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top