在VBA中单击按钮更改标签文本

时间:2017-11-10 17:16:30

标签: vb.net forms text label

我是VBA新手,我有以下代码:

Private Sub CommandButton3_Click()
CommandButton2.Enabled = False

Dim x As Integer

For x = 1 To 14
    Me.Controls("textbox" & x).Value = ""
Next x

Application.DoEvents


'Probleeeeeeeeem

Me.Label8.Text = ""
Me.Label9.Text = ""
Me.Label10.Text = ""
Me.Label11.Text = ""
Me.Label12.Text = ""
Me.Label13.Text = ""

End Sub

标签文本(从8到13)已经有一些由另一段代码生成的值。如何将这些值更改为CommandButton3_Click()的空字符串? 我尝试了Application.DoEventsMe.Refresh但是徒劳无功,这是我收到的错误消息:

Error message

谢谢

0 个答案:

没有答案