Auto vbyes in Inputbox?

Trinic

New Member
Joined
Sep 18, 2019
Messages
3
Hey.

Iam wondering if its possible to to code or do something with inputbox.

The thing i need. my costumer is going to put in a value of 7 numbers/letters, and then press Yes.

Is it possible to do the "yes" button automatic when 7 numbers/letters is filled in?

Ex:

inputbox is appearing, customer writing "HDD+1234" (or we scan a barcode), then press "Yes".


So i want automatically that the "yes" button is press or activating "vbyes" after 7 words/letters is put in.
hope is possible or maybe a workaround.

Thanks
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
I'll do you the favor of responding on this. While technically it IS possible, it would require some difficult windows hooks and other complicated API to accomplish and unless someone is feeling very generous of their time or has some existing code that does this, I suspect you may not see an answer.

There is nothing in-built with Excel to do this in a straight-forward manner.
 
Upvote 0
aahh. then i hope someone has done it and maybe can share the code.

Really thanks for the answer. you are awesome(Y)
 
Upvote 0
Hi @★ Trinic, welcome to the forum.

Other alternatives can be a textbox in a userform or a textbox activex directly on the sheet.
The code would be something like this:


Code:
Private Sub TextBox1_Change()
  If Len(TextBox1) = 7 Then
    'do the activities
    MsgBox "7 letter"
    End
  End If
End Sub
 
Upvote 0
you may have more luck with a userform as it has activex controls?
i'm not 100% on this, but since inputbox is not activex then it will not be able to detect input without use of api

that being said i did come across this article
https://stackoverflow.com/questions...res-when-keys-are-pressed-when-editing-a-cell

if you can understand the code here i'm sure you can amend it to do what you're asking whether thats by cell or userform.
because i sure don't understand it :ROFLMAO:
 
Upvote 0
You are awesome guys! @DanteAmor i was trying your form, and it works awesome (Y) really thanks @BlakeSkate thanks for for the answer and the link i will look at int and try to understand it.

Thanks for the fast answer thanks alot. I am a happy guy right now =D
 
Upvote 0
Im glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,620
Messages
6,120,554
Members
448,970
Latest member
kennimack

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