|
楼主 |
发表于 2016-8-13 14:26
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub Click()
On Error Resume Next
a = Sheets("产品号码").UsedRange.Columns.Count
c = Sheets("产品号码").UsedRange.Rows.Count
arr = Sheets("产品号码").Range("e2:" & Sheets("产品号码").Cells(c, a).Address(0, 0))
For i = 1 To UBound(arr)
For k = 1 To UBound(arr, 2)
arr1 = Split(arr(i, k), "-")
If arr1(0) = Sheets(2).[a1] And Sheets(2).[b1] <= arr1(2) And Sheets(2).[b1] >= arr1(1) Then
GoTo 100
Exit For
Else
MsgBox "没有您要查寻的值,请检查后重新输入"
GoTo 200
End If
Next
Next
100:
Sheets("产品号码").Activate
Sheets("产品号码").Cells(i + 1, k + 4).Select
200:
End Sub
|
|