1
/5
Open Excel and press Alt+F 1 1 to open the VBA editing interface, as shown in the figure below.
2
/5
VBA in Excel can use Sendkeys function to simulate keyboard input, and the input characters can be directly used as parameters of the function, such as Sendkeys“ABC ",directly simulating keyboard input string" ABC ",as shown in the following figure.
three
/5
If it is an analog keyboard to input function keys, you can directly use braces+key names. For example, SendKeys“{ Enter} "is an analog keyboard used to press Enter, as shown in the following figure.
four
/5
If you enter a key combination, you can use the form of key name+key name, or you can use an abbreviated form. For example, sendkeys "g" is to simulate the keyboard pressing Ctrl+G, as shown in the figure below.
five
/5
When you return to Excel to execute a macro, enter "ABC" in the selected cell, then press Enter, and then press CTRL+G. The result is shown in the following figure.
Summary:
1
/ 1
1. Open Excel and press ALT+F11;
2. Use sendkeys“ABC "and other words to enter the string;
3. Press the function key and use the send key "{enter} ";;
4. Press the key combination, and use such as sendkeys "g.
5. When the code is executed, the characters or keys in the code are input on the analog keyboard.