本帖最後由 av8d 於 2012-6-1 16:31 編輯
Y = Year(TextBox1)
M = Month(TextBox1)
D = Day(TextBox1)
If OptionButton1 = True Then
OB1 = "收入"
Else
OB1 = "支出"
End If
If OptionButton4 = True Then
OB4 = "薪資"
Else
OB4 = TextBox3
End If
Sheets("Data").Cells(Rows.Count, "A").End(3)(2, 1).Resize(1, 5) = Array(DateSerial(Y, M, D), OB1, TextBox2, OB4, TextBox4)
由於DateSerial(Y, M, D)格式是年月日∼我把輸出後的儲存格格是改成 年月日 時:分 (24小時制)
他則會固定出現12:00 AM∼應該是因為我當時沒有設定∼我該如何改寫呢? 謝謝! |