'建立當日筆數
Dim v As Integer 'Integer整數類型
Dim Q As Integer
v = Sheets("data").Cells(ActiveSheet.Rows.Count, 1).End(xlUp).Row '最後一欄是第v欄
'某欄最底列 Cells(Rows.Count, 欄).End(xlUp).Row
'End(xlUp)為ctrl+向下
Q = Sheets("data").Cells(v, "D")
If Sheets("傳票登錄").Cells(5, "C") = Sheets("data").Cells(v, "D") Then '日期在資料庫裡有重複的話