ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pausing a macro while waiting for an input into a cell (https://www.excelbanter.com/excel-programming/367657-pausing-macro-while-waiting-input-into-cell.html)

Francois Ashton[_2_]

Pausing a macro while waiting for an input into a cell
 
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



colofnature[_94_]

Pausing a macro while waiting for an input into a cell
 

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


--
colofnature
------------------------------------------------------------------------
colofnature's Profile: http://www.excelforum.com/member.php...o&userid=34356
View this thread: http://www.excelforum.com/showthread...hreadid=562799


NickHK

Pausing a macro while waiting for an input into a cell
 
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

"Francois Ashton" wrote in message
...
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





Francois Ashton[_2_]

Pausing a macro while waiting for an input into a cell
 
Thanks NickHK and col

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

Francois

"NickHK" wrote in message
...
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

"Francois Ashton" wrote in message
...
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








All times are GMT +1. The time now is 08:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com