Excel vba enter key run macro

I am sure that this should be simple, but for my life I cannot find how to do it.

How to determine that the enter key is pressed in a specific range of cells

I have a group of merged cells ($ H $ 9: $ K $ 13), which is basically a field that the user enters into a number. I want to run a macro after the user presses input (on the keyboard NOT num numpad)

On this I can not find examples. I can find an example by doing this from a text box, but not from a cell

I tried Application.onkeys, which works with keyboard shortcuts but not on the enter key (it says the tilde to enter the key and ENTER for the num pad, but it doesn't work)

0
source share
1 answer

Are you sure you want to detect the ENTER key press event?

What do you think, if users used the tab key to change the input of certain cells that you marked in your message. Or the selection range was changed due to a change in the value of the mouse click in the cell.

I'm a little confused because using the Workbook.SheetChange Event , you can run procedures for your purpose. Of course, you can verify that the changed range was in the range you specified or not, in which case the procedure uses the Target argument.

0
source

Source: https://habr.com/ru/post/1275125/


All Articles