ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   automatically running a macro (https://www.excelbanter.com/excel-discussion-misc-queries/23603-automatically-running-macro.html)

42410

automatically running a macro
 
Hello,
I have written a macro which operates by means of ctrl + Q. (This letter was
merely an arbitrary choice!)

The action is as follows:-
1. Enter new data in a cell then press <ENTER
2. The data is then automatically compared with the contents of a cell on
different sheet
3. If the new cell data is greater than or equal in value to that data in
the cell on the other sheet then change the font colour of the new cell data
to red and display the difference between the two cells in a cell in another
column
4. Otherwise just display the new contents of the cell in a black font
colour as normal and do nothing else

I have the code to do all this in the macro but I want to make the code run
automatically when I press <ENTER after updating the contents of any one of
several cells on a worksheet.

I don't know how to do this by means of an IF function, as it requires
several things to happen as the data in the cell is entered.

Can anyone tell me how to do it?

Thank you in advance for your kind help.

Steve



Bob Phillips

see response in .misc

--

HTH

RP
(remove nothere from the email address if mailing direct)


"42410" wrote in message
...
Hello,
I have written a macro which operates by means of ctrl + Q. (This letter

was
merely an arbitrary choice!)

The action is as follows:-
1. Enter new data in a cell then press <ENTER
2. The data is then automatically compared with the contents of a cell on
different sheet
3. If the new cell data is greater than or equal in value to that data in
the cell on the other sheet then change the font colour of the new cell

data
to red and display the difference between the two cells in a cell in

another
column
4. Otherwise just display the new contents of the cell in a black font
colour as normal and do nothing else

I have the code to do all this in the macro but I want to make the code

run
automatically when I press <ENTER after updating the contents of any one

of
several cells on a worksheet.

I don't know how to do this by means of an IF function, as it requires
several things to happen as the data in the cell is entered.

Can anyone tell me how to do it?

Thank you in advance for your kind help.

Steve





42410

Sorted. Thanks.
Steve
"Bob Phillips" wrote in message
...
see response in .misc

--

HTH

RP
(remove nothere from the email address if mailing direct)


"42410" wrote in message
...
Hello,
I have written a macro which operates by means of ctrl + Q. (This letter

was
merely an arbitrary choice!)

The action is as follows:-
1. Enter new data in a cell then press <ENTER
2. The data is then automatically compared with the contents of a cell

on
different sheet
3. If the new cell data is greater than or equal in value to that data

in
the cell on the other sheet then change the font colour of the new cell

data
to red and display the difference between the two cells in a cell in

another
column
4. Otherwise just display the new contents of the cell in a black font
colour as normal and do nothing else

I have the code to do all this in the macro but I want to make the code

run
automatically when I press <ENTER after updating the contents of any

one
of
several cells on a worksheet.

I don't know how to do this by means of an IF function, as it requires
several things to happen as the data in the cell is entered.

Can anyone tell me how to do it?

Thank you in advance for your kind help.

Steve








All times are GMT +1. The time now is 06:40 PM.

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