Oseitutuakrasi
New Member
- Joined
- Jun 7, 2023
- Messages
- 38
- Office Version
- 365
- Platform
- Windows
Dear All,
Admittedly, I'm not sure if this is possible. I can directly enter an ascii character (such as a % sign) into a Textbox by using the Numlock keypads with the ALT key.
That is fine. But I want this to happen automatically when I activate the form. This is what I have done:
UserForm1.Activate()
Sendkeys "{Numlock}", True ' To activate pressing the NumLock key
Sendkeys ("%8373") ' I am told that the % simulates the ALT key. So, I am pressing the ALT key as I enter 8373
End Sub
I was hoping that the above code will simulate pressing the NumLock key, then press (and hold down) the ALT as I enter the code 8373
However, when the form opens the text box contains only 373. The 8 is missing and the character I was expecting does not appear. I have the feeling that the ALT key does not stay down, but I could be wrong. Any help please?
Regards,
Sam
Admittedly, I'm not sure if this is possible. I can directly enter an ascii character (such as a % sign) into a Textbox by using the Numlock keypads with the ALT key.
That is fine. But I want this to happen automatically when I activate the form. This is what I have done:
UserForm1.Activate()
Sendkeys "{Numlock}", True ' To activate pressing the NumLock key
Sendkeys ("%8373") ' I am told that the % simulates the ALT key. So, I am pressing the ALT key as I enter 8373
End Sub
I was hoping that the above code will simulate pressing the NumLock key, then press (and hold down) the ALT as I enter the code 8373
However, when the form opens the text box contains only 373. The 8 is missing and the character I was expecting does not appear. I have the feeling that the ALT key does not stay down, but I could be wrong. Any help please?
Regards,
Sam