Automating a macro

ddsole

New Member
Joined
Aug 21, 2002
Messages
1
I have a spreadsheet that continuously performs calculations with time. It is updated every second. There are cells with formulas that are continuously incrementing as the seconds count on. When a certain condition is reached, as indicated by a cell with a TRUE/FALSE condition, I want to automatically paste the value of the incrementing cell into another cell. I perform this now with a macro that uses the paste special value option, watch for when the indicator cell goes true, and manually enter the macro execute key. Is this someway to make the macro automatically execute when the indicator cell goes TRUE?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
There are many ways, but in your case it is actually a macro that causes the change in the first place (or so I gather from your description)... so you can add a couple of lines to the same macro to check for the result of the previous calculation before triggering the next one.

Perhaps your once-a-second calc. is triggered using OnTime? if so, you can add:

If range("TrueFalse") then CopyResult

at the top of the event handler, and put your copying routine in Sub CopyResult()
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,081
Members
453,021
Latest member
Justyna P

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