I have an Excel file which needs to deal with checkboxes. The names of the checkboxes are defined automatically in French (due to my installation being french). For example "Case à cocher 100" instead of "Checkbox 100".
However, when our sibling company uses this Excel file, it crashes due to their installation being English.
Is there a way to make the following work for English and French?
ActiveSheet.CheckBoxes("Case à cocher 488").Interior.Color = RGB(255, 255, 255)
ActiveSheet.CheckBoxes("Case à cocher 383").Interior.Color = RGB(255, 255, 255)
ActiveSheet.CheckBoxes("Case à cocher 467").Interior.Color = RGB(255, 255, 255)
ActiveSheet.CheckBoxes("Case à cocher 461").Interior.Color = RGB(255, 255, 255)
ActiveSheet.CheckBoxes("Case à cocher 460").Interior.Color = RGB(255, 255, 255)
ActiveSheet.CheckBoxes("Case à cocher 459").Interior.Color = RGB(255, 255, 255)
ActiveSheet.CheckBoxes("Case à cocher 458").Interior.Color = RGB(255, 255, 255)
ActiveSheet.CheckBoxes("Case à cocher 8").Interior.Color = RGB(255, 255, 255)
I can't seem to find a way to rename the checkbox's name.
Check for the regional settings and then decide which one to use.
Try this
Sub Sample()
Dim CBNAME As String
Select Case Application.International(XlApplicationInternational.xlCountryCode)
Case 1 '<~~ English
CBNAME = "CheckBox"
Case 33 '<~~ French
CBNAME = "Case à cocher"
End Select
ActiveSheet.CheckBoxes(CBNAME & " 488").Interior.Color = RGB(255, 255, 255)
End Sub
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With