0
那麼,這裏是我的問題到目前爲止,我有一個在這種形式在VB中的窗體用戶把我想要做的一個數字是在Sheet2中的Excel搜索如果我得到這個數字(如果是買了),並在活動工作表「數據」如果已被捕獲,最後將其放入Sheet1中最後一個空行。如何在Excel中的另一張表格中以及使用表格的活動工作表中找到值?
我有這個到目前爲止。
Private Sub CommandButton1_Click()
Me.TextBox1.Text = ""
Me.TextBox2.Text = ""
End Sub
Private Sub CommandButton2_Click()
Dim lastrow As Double
Dim frange As Range
lastrow = ActiveSheet.UsedRange.Row - 1 + ActiveSheet.UsedRange.Rows.Count
If TextBox1.Text = TextBox2.Text Then
Sheets("Sheet2").Activate
ActiveSheet.Range("A2").Select
If Range("A2:A200").Find(What:=TextBox2.Value _
, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate Then
Sheets("Datos").Activate
If Range("A3:A200").Find(What:=TextBox2.Value _
, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate Then
MsgBox ("This number is already registred")
Else
Cells(lastrow + 1, 1) = TextBox2.Value
End If
Else
MsgBox ("The number has not been buyed")
End If
Else
MsgBox ("The number are not the same")
End If
End Sub
我真的很希望有人能幫助我,因爲我被卡住了,我沒有看到答案。
感謝
對不起,我的英語
WOW完美地完成了非常感謝你。 – 2012-07-31 16:29:51