VB 中 2个数组进行对比,如果数组的值全一致,按钮可用,怎么写呢?
自己做了一个循环,但是这样做有问题,不能实现,如果数组的值全一致,按钮可用
For i = 0 To 7
'转换为大写字母UCase(a)
a(i) = UCase(newsheet.cells(1, i + 1))If (a(i) <> b(i)) Then
MsgBox "列" & i + 1 & "错误:" & newsheet.cells(1, i + 1), "0", "提示"
Command1.Enabled = False
Else
Command1.Enabled = True
End If
自己做了一个循环,但是这样做有问题,不能实现,如果数组的值全一致,按钮可用
For i = 0 To 7
'转换为大写字母UCase(a)
a(i) = UCase(newsheet.cells(1, i + 1))If (a(i) <> b(i)) Then
MsgBox "列" & i + 1 & "错误:" & newsheet.cells(1, i + 1), "0", "提示"
Command1.Enabled = False
Else
Command1.Enabled = True
End If
解决方案 »
- 图片降噪
- vb中查找替换word指定字符串的问题,因为替换字符串太长了
- [重点版务]VB版版主调整以及版块调整条论
- 在线等,如何做一张报表……
- 終於在CSDN裡碰到chelseawu (不想做菜鳥的MM),特散100分
- 请问各位朋友网上哪有下载vb书籍比较好的站点。多谢
- VB里面有没有像Html 的Form的Reset方法?难道要自己记住初始值来实现重置吗?
- 在vb中如何将ado返回的数据集显示在一个列表中?(在线等待)
- [求助] 自定义控件的LOAD为什么没系统的LABEL快
- VS2015中将Excel中指定range区域赋值给一个二维数组
- 这么多显示窗口的API竟然都无法让我的窗口前台激活!!!
- 急求一段VBA代码
'转换为大写字母UCase(a)
a(i) = UCase(newsheet.cells(1, i + 1))If (a(i) <> b(i)) Then
MsgBox "列" & i + 1 & "错误:" & newsheet.cells(1, i + 1), "0", "提示"
Command1.Enabled = False
exit for '这里加个退出代码,继续执行到相同的最后按钮还是会被重新设置为true的
Else
Command1.Enabled = True
End If或者改成这样也行:
Command1.Enabled = True
For i = 0 To 7
'转换为大写字母UCase(a)
a(i) = UCase(newsheet.cells(1, i + 1))If (a(i) <> b(i)) Then
MsgBox "列" & i + 1 & "错误:" & newsheet.cells(1, i + 1), "0", "提示"
Command1.Enabled = False
exit for '这里加个退出代码,继续执行到相同的最后按钮还是会被重新设置为true的
End If