我想问下扫描枪在EXCEL表扫描条码时录入数据 用VBA怎么实现几个功能
发布网友
发布时间:2024-01-01 09:01
我来回答
共2个回答
热心网友
时间:2024-04-09 08:51
Option Explicit
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Count <> 1 Then Exit Sub
Dim sh1 As Worksheet
Set sh1 = Target.Worksheet
Dim tempvalue As String
tempvalue = Target.Value
Dim F As WorksheetFunction
Set F = WorksheetFunction
If F.CountIf(sh1.UsedRange, tempvalue) > 1 Then
Target = ""
Target.Select
End If
End Sub
上面代码拷贝到 ThisWorkBook 模块里面
热心网友
时间:2024-04-09 08:48
动检查是否存在另一所录入内容完全相同