さて、これまでのところ私の問題です。私はこのフォームにVBのフォームを持っています。ユーザーは数字を入力します。私がやりたいことは、Sheet2でExcel検索を行うことです。この数字を取得した場合(購入した場合)、アクティブなシートで「データ」が既にキャプチャされている場合は、最後にシート 1 の最後の空の A 行に配置します。
私はこれまでのところこれを持っています。
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
私は立ち往生していて答えが見えないので、誰かが私を助けてくれることを本当に願っています.
ありがとう
私の英語でごめんなさい