连续两列扫码后自动换行
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column() = 2 Then
Cells(Target.Row(), 3).Select
ElseIf Target.Column() = 3 Then
Cells(Target.Row() + 1, 2).Select
End If
End Sub
两列码对比结果,不同的跳出对话框报警
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Cells(Target.Row, 1) <> "" And Cells(Target.Row, 2) <> "" Then
If Cells(Target.Row, 3).Value <> 0 Then
MsgBox "A" & Target.Row & "与B" & Target.Row & "内容不相同,请留意!", vbOKOnly + vbExclamation, "警告!"
End If
End If
End Sub
如何让上面两个代码合并到一起执行,请大神指导!