I'd like to make a macro button to refresh the worksheets (F9 function) until Q column values are all TRUE

Jasperlee93

New Member
Joined
Dec 6, 2022
Messages
7
Office Version
  1. 365
Platform
  1. Windows
There is a Q column with formulas
I'd like to make a macro button to refresh the worksheets (F9 function) until Q column values are all TRUE .

any helps will be apprecitated.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Untested, Try this non loop faster version:
VBA Code:
Sub RefreshUntilTrue()
    Dim rng As Range
    Set rng = Range("Q1:Q" & Cells(Rows.Count, "Q").End(xlUp).Row)
   
    Do Until Application.WorksheetFunction.CountIf(rng, False) = 0
        Application.Calculate
    Loop
   
    Exit Sub

Or this loop version:
VBA Code:
Sub RefreshUntilTrue()
    Dim allTrue As Boolean
    Do While Not allTrue
        ActiveSheet.Calculate
        allTrue = True
        For Each cell In Range("Q1:Q" & Cells(Rows.Count, "Q").End(xlUp).Row)
            If cell.Value <> True Then
                allTrue = False
                Exit For
            End If
        Next cell
    Loop
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,836
Messages
6,127,179
Members
449,368
Latest member
JayHo

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