Sub c1() '判断是否存在,并查找所在行数
Dim hao As Integer
Dim icount As Integer, I
icount = Application.WorksheetFunction.CountIf(Sheets("库存明细表").[b:b], [g3])
If icount > 0 Then
MsgBox "该入库单号码已经存在,请不要重复录入"
For I = 2 To Sheets("库存明细表").Range("A65536").End(3).Row
If Sheets("库存明细表").Cells(I, 2) = Range("G3") Then Exit For
Next
MsgBox I
'MsgBox Application.WorksheetFunction.Match([g3], Sheets("库存明细表").[b:b], 0)
End If
End Sub