- 帖子
- 15
- 主題
- 9
- 精華
- 0
- 積分
- 54
- 點名
- 0
- 作業系統
- windows 7
- 軟體版本
- 2010
- 閱讀權限
- 20
- 註冊時間
- 2015-2-13
- 最後登錄
- 2024-3-1
|
請問我匯入資料時
我匯入資料時想要先讓他篩選之前資料有無匯入過,沒有的話就匯入,有的話就跳出提示視窗,
以下我的語法
Private Sub CB1_Click()
If [A1] = "" Then
MsgBox ("條碼沒刷!")
Else
If [A2] = "" Then
MsgBox ("條碼!忘了刷?")
Else
If [A3] = "" Then
MsgBox ("你哪位?")
Else
If [B11] = "" Then
MsgBox ("你忘了按!")
Else
Dim iRow As Long
iRow = ActiveSheet.Range("c65536").End(xlUp).Row
Dim AOAend As Integer
AOAend = Sheets("AOA").Columns(iRow).Find("*", , , , , xlPrevious).Row
Sheets("AOA").Cells(AOAend + 1, "c") = [b6]
Sheets("AOA").Cells(AOAend + 1, "F") = [b7]
Sheets("AOA").Cells(AOAend + 1, "e") = [b8]
Sheets("AOA").Cells(AOAend + 1, "I") = [b9]
Sheets("AOA").Cells(AOAend + 1, "K") = [b10]
Sheets("AOA").Cells(AOAend + 1, "j") = [B11]
Sheets("AOA").Cells(AOAend + 1, "A") = AOAend - 1
[A1] = ""
[A2] = ""
[A3] = ""
[B11] = ""
Com002_1.BackColor = &H8000000F
Com002_2.BackColor = &H8000000F
Com002_3.BackColor = &H8000000F
Com002_4.BackColor = &H8000000F
Com002_1.ForeColor = &H80000012
Com002_2.ForeColor = &H80000012
Com002_3.ForeColor = &H80000012
Com002_4.ForeColor = &H80000012
End If
End If
End If
End If
End Sub |
|