|
本帖最后由 mkm-_7605 于 2024-11-9 10:45 编辑
要个语句 就是判断c列输入的内容规定在aw2:aw50内的内容
我就是想要个语句判断c5:C667输入的内容是否是aw2:aw50内的内容 如果不是显示错误,如果是就直接显示这个内容
If Cells(i, 3) <> "" And Cells(i, 4) <> "aW2:aW42" Then Cells(i, 3).Value = "输入错误"
我写的他都判断是错误
Sub qc()
Application.ScreenUpdating = False
Application.EnableEvents = False
lr = Range("a65536").End(xlUp).Row
For i = 1 To lr
If InStr(Cells(i, 5).Value, "0") Then Cells(i, 5).Value = "'" & Cells(i, 5)
If InStr(Cells(i, 6).Value, "0") Then Cells(i, 6).Value = "'" & Cells(i, 6)
If InStr(Cells(i, 4).Value, "同种异体骨") And Cells(i, 19) <> "" Then Cells(i, 28).Value = "1"
If InStr(Cells(i, 4).Value, "骨植入材料") And Cells(i, 19) <> "" Then Cells(i, 28).Value = 1
If InStr(Cells(i, 4).Value, "一次性使用负压引流护创材料包") And Cells(i, 19) <> "" Then Cells(i, 30).Value = 1
If Cells(i, 3) <> "" And Cells(i, 4) <> "aW2:aW42" Then Cells(i, 3).Value = "输入错误"
Next
Me.ListBox1.Visible = False
Me.TextBox1.Visible = False
Me.TextBox1.Value = ""
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
|
|