I have an UserForm where user will check the checkbox, which will be copied to the Excel sheet. When opening the UserForm, It will check the data from Excel sheet and while clicked on Apply button on UserForm, UserForm data will be placed in the Excel Sheet.
CheckBox Objects will be like -
UserFrom Name : Config
CheckBox Names : B1M101, B1M102, B1M103 (will be supplied dyanmically)
Here is my working, (which is not working) -
For i2 = 1 To 99
ModuleN = "B1M10"+i2
BeckDIE = "Config." + ModuleN
BeckDIV = "Config." + ModuleN
ExIntCellE = Sheets("Internal").Cells(RowStart + i2, EnableModify)
ExIntCellV = Sheets("Internal").Cells(RowStart + i2, ValueModify)
BeckDIE.Enabled = ExIntCellE.Value 'Getting Compile Error Here
BeckDIV.Value = ExIntCellV.Value 'Getting Compile Error Here
Next i2
So, i am trying to copy the values from Excel Sheet "Internal" to the CheckBoxs in the UserForm. But when i am executing this code, i am getting the Compiler Error : Invalid qualifier Error during the execution -
BeckDIE.Enabled = ExIntCellE.Value
BeckDIV.Value = ExIntCellV.Value
How can i assign the Excel Sheet Cell Value to the Dynamically created CheckBox ObjectName as string ?
I have tried to execute many forms like Application.Evaluate or Eval functions by only Executing the String Name as Object or Entire Name -
Application.Evaluate(BeckDIE).Enabled = False
Eval(BeckDIE).Enabled = False
Application.Evaluate(BeckDIE + ".Enabled") = False
Eval(BeckDIE + ".Enabled") = False
But, No luck. It's giving error.
Worksheets("Sheet1").Shapes("CheckBoxName").OLEFormat.Object.Caption = "aaa". If the CheckBox is on a userform useControls("CheckBox1").Captionto access it by its name: eg.Controls(BeckDIE).Caption- Pᴇʜ