請問 我的VBA表單內怎麼做才能使 TEXTBOX 內輸入的值如果有重複
跳一個MSGBOX出來警告
我可以怎麼修改 我的VBA目前是這樣
Private Sub CB1_Click()
Dim Rng As Range
Set Rng = Range("B1:B1000").Find(TB2, lookat:=xlPart)
If Rng Is Nothing Then
MsgBox "無此車位"
Else
r = Rng.Row
Cells(r, "A") = TB1.Text
Cells(r, "C") = CBB1.Text
Cells(r, "D") = TB3.Text
Cells(r, "E") = CBB2.Text
Cells(r, "F") = TB4.Text
Cells(r, "G") = CBB3.Text
Cells(r, "H") = TB5.Text
Cells(r, "B").Select
TB1.Text = ""
CBB1.Text = ""
TB2.Text = ""
CBB2.Text = ""
TB3.Text = ""
CBB3.Text = ""
TB4.Text = ""
TB5.Text = ""
End If
End Sub
我看不懂你要做什麼
參考看看有沒有用
Sub Macro1()
If Cells(3, 3) = "Text" Then
MsgBox "有重覆資料", vbInformation
End If
If Cells(3, 3) = TB1.Text Then
MsgBox "有重覆資料", vbInformation
End If
If TB1.Text = "999" Then
MsgBox "有重覆資料", vbInformation
End If
If TB1.Text = TB2.Text Then
MsgBox "有重覆資料", vbInformation
End If
End Sub