Home > other >  How to use VBA to realize the data effectively, and the only check!
How to use VBA to realize the data effectively, and the only check!

Time:02-11

How to use VBA to realize the data check!


In the first listed as the user input code, Sheet1, take the first b -s as standard code
Requirements on the user's input, inspection on entry code ( take space data ), before the inspection content:

1: in the first column entry code must exist in the first b -s column, there is no prompt entry "does not exist!" " And there is an error sound (voice source files in C: \ 1. Wma)
2: in the first column type code must be the only, the same code for input prompt "repeat! "And there is an error sound (voice source files in C: \ 1. Wma)

As the first standard code for: A001, A002, A003, A004, A005, A006, A007, A008, A009, A010 total N

When users in the first column entry, only can input more than 10 defined code, input other tooltips don't exist "does not exist"
If entry 'B001, tip' code does not exist; As a code of multiple entry, prompt input repeat,
Such as in the first row 2 column entry 'A001, line 3 entry' A001 again, prompt input repeat.

Thank you very much!

Know now that use of the code is

Private Sub Worksheet_Change (ByVal target As Range)
Application. EnableEvents=False 'close events
If the target. The Value & lt;> . "" Then target Value=https://bbs.csdn.net/topics/Left (target) Value, InStr (target) Value," ") - 1)
Application. EnableEvents=True 'open event
End Sub

Now is less likely to use a dictionary and know the function is to use a dictionary,

CodePudding user response:

If at the time of entry, can lock the excel window and on the cell, so much the better
  • Related