Highlight Active row

Hi Erik :)
I'm not sure what you suggesting. Any change to a worksheet by a macro (called by OnTime or not) clears the undo stack. So even if you call the macro by OnTime, the undo stack will be cleared.
Or did I just completely fail to get what you were saying?
As you know I'm not a "real programmer". Consequently this involves some limitations but also advantages. I will try out things which a programmer wouldn't, because he thinks it's not possible.
Perhaps my explanation in the other post was to short.
*if you absolutely want to use a cell, whithout the drawback, there is a trick: use running-clock on other (hidden) sheet and refer to there with a formula
If you change sheet1 by code, you will still be able to have undo on sheet2. It is not OnTime specific.

Put =Sheet1!A1 in some cell on sheet2.
Change something on sheet2.
Run this code (even mutiple times)
Code:
Sub test()
    With Sheets("Sheet1").Range("A1")
    .Value = .Value & "&"
    End With
End Sub
You will see that "&" is added on sheet1, reflected on sheet2, because of the formula. But you have still undo available!!

You have still Undi available, when you run
Code:
    With Range("A1")
    .Value = .Value & "&"
    End With
while sheet1 is active.

If you want, throw me an email. "time running in cell" I'll send you an example.

best regards,
Erik
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
What Erik is saying is that it is not always true that running a macro will clear the stack. There are some things a macro can do that won't clear the stack. But, that is beside the point. The point here is how do you save the stack.
 

Forum statistics

Threads
1,222,684
Messages
6,167,630
Members
452,124
Latest member
lozdemr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top