View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mark Mark is offline
external usenet poster
 
Posts: 989
Default Worksheet Change event code, but retain Undo?

Hi.

A team here wanted some formatting, dependent upon 4 other cells, in an OR
formula.

if =or(f33<f39,f34<f40) is true, they want cell f1 to have a red background.
If it's false, it has the default blue background.

Since conditional formatting is only dependent upon the value of the cell to
which the cell is being applied, the way I saw to do this was with some
custom code.

I put some code into the worksheet_change event which does the formatting
fine.

But, now the Undo button is not available... running the custom code takes
away the possibility of Undo. (no particular surprise).

Is there a way to have both?

Thanks,
Mark