Macros only work after worksheet has been opened for a few minutes

Dagobah_68

New Member
Joined
Jan 9, 2018
Messages
1
Hello everyone, I am working on an excel medical questionnaire using form checkboxes on a worksheet, the questionnaire is devided into several categories, each categorie uses a macro like the following to select a certain option for all items in a given categorie:

Sub SelectAll_Click_Bewusstseinsstörungen()
Dim CB As CheckBox
Dim Nicht_Vorhanden As Range
Dim leichtgradige As Range
Dim mittelgradige As Range
Dim schwergradige As Range
Dim keineAussage As Range
Set Nicht_Vorhanden = Hoja2.Range("E3:E7")
Set leichtgradige = Hoja2.Range("F3:F7")
Set mittelgradige = Hoja2.Range("G3:G7")
Set schwergradige = Hoja2.Range("H3:H7")
Set keineAussage = Hoja2.Range("I3:I7")
For Each CB In Hoja2.CheckBoxes
If Not Intersect(CB.TopLeftCell, Nicht_Vorhanden) Is Nothing Then
CB.Value = Hoja2.CheckBoxes("Check Box 144").Value
End If
If Not Intersect(CB.TopLeftCell, leichtgradige) Is Nothing Then
CB.Value = xlOff
End If
If Not Intersect(CB.TopLeftCell, mittelgradige) Is Nothing Then
CB.Value = xlOff
End If
If Not Intersect(CB.TopLeftCell, schwergradige) Is Nothing Then
CB.Value = xlOff
End If
If Not Intersect(CB.TopLeftCell, keineAussage) Is Nothing Then
CB.Value = xlOff
End If
Next CB
End Sub

Variations of the this Macro are used for each of the other categories. Most Macros work fine, but some only start working properly only after the worksheet has been open for a few minutes, if you click them before, some checkboxes are left unticked. I can't understand why this happens. The worksheet is not that big. Any ideas? Thanks.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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