VBA帮助 – 需要将特定单元格的文本返回到选项button

我需要帮助才能从特定单元格返回文本,如果文本与选项button的configuration相匹配,则此选项button将设置为true。

我试图用下面的代码:

Dim texto1 As String texto1 = "Testando Texto" If Range("D3").Value = texto1 Then OptionButton1.Value = True End If 

对于选项button(表单控件):

 ActiveSheet.Shapes("Option Button 1").ControlFormat.Value = True 

对于选项button(表单上的ActiveX控件):

 ActiveSheet.OptionButton1.Value = True 

对于选项button(在表单上):

 Me.OptionButton1.Value = True 

仅供参考:你可以使用Me.OptionButton1.Caption = your string如果你想在你的问题的标题。