Pausing a macro while waiting for an input into a cell

F

Francois Ashton

Hi all

Hopefully this is not a dumb question and has probably been asked before,
but I can't find the answer at the moment.

I need a macro to be paused while waiting for a user to input a value into a
cell. So once the value is inputed in the cell and "enter" is hit the macro
continues.

I want to try to avaiod using input boxes.

Help is appreciated.

Francois
 
C

colofnature

Don't think this is possible - the closest I've managed to get is to
split the macro in two at the point where the input is required, lock
all the cells except the one I want the data in, set the worksheet's
EnableSelection property to xlUnlockedCells and then use the
Worksheet_Change event to detect when the user has entered any input.
It's a long-winded way of doing it, but it does work.

If anyone else knows a better way I'd be very interested to see (and
steal! :) ) it.
Col
 
N

NickHK

Francois,
Macro code does not run anyway when the user is in Edit Mode.
And the can't enter Edit Mode whilst there is code running.

To start code after input, put it in the Worksheet_Change event.

NickHK
 
F

Francois Ashton

Thanks NickHK and col

I am sure I can do something with this. I thought this might be the case.

Francois
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top