Getting Excel to Recaclulate IF Macro

mcphatt

New Member
Joined
Jul 7, 2011
Messages
11
Hi everyone,

I have a macro button which calculates the active sheet, which is fine, but sometimes the division which the sheet is doing throws up a solution which is not an integer. So, I was wondering if I can put an if statement into the macro code to tell excel to keep calculate until it returns an interger.

Essentially I want:

IF F12<>INT THEN ActiveSheet.Calculate

but I don't know how to put this in code form.

Thanks
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Maybe like this

Code:
Do Until Range("F12").Value = Int(Range("F12").Value)
    Calculate
Loop
 
Upvote 0

Forum statistics

Threads
1,226,227
Messages
6,189,753
Members
453,567
Latest member
kentbarbie

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