Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个带有一系列标签的表格,从 lbWeight1 到 lbWeight20。VBA有没有办法遍历每个并将标题设置为“0”?目前我有20行:
lbWeight1.Caption = "0"
每个标签一个。我的方法有效,只是在可能的情况下寻找更好的解决方案。
不知道你是如何设置的。如果它在按钮上或负载上。但这可能适用于您正在尝试做的事情。
Private Sub btnTest_Click() Dim x As Integer For x = 1 To 20 Me("lbWeight" & x).Caption = "0" Next End Sub