Page 1 of 1
Save วันที่เป็น Format Date
Posted: Sat Mar 23, 2013 11:27 am
by jaruek
เรียน อาจาร์ย์ ครับ ต้องการให้ Save วันที่เป็น Format ของวันที่ ต้องใช้คำสั่งอะไรใน VBA Code ครับ ตัวอย่าง ws.Cells(erow, 1) = TextBox23.Text เวลา Save ตอนนี้เป็น General ครับต้องปรับ Format อย่างไรครับ
ขอบคุณครับ
Re: Save วันที่เป็น Format Date
Posted: Sat Mar 23, 2013 11:36 am
by snasui

เมื่อใส่ค่าแล้วก็จัด format ให้กับเซลล์นั้น ๆ ด้วยครับ
Code: Select all
ws.Cells(erow, 1) = TextBox23.Text
ws.Cells(erow, 1).NumberFormat = "dd/mm/yyyy"
Re: Save วันที่เป็น Format Date
Posted: Sat Mar 23, 2013 11:37 am
by jaruek
snasui wrote:
เมื่อใส่ค่าแล้วก็จัด format ให้กับเซลล์นั้น ๆ ด้วยครับ
Code: Select all
ws.Cells(erow, 1) = TextBox23.Text
ws.Cells(erow, 1).NumberFormat = "dd/mm/yyyy"
ได้แล้วครับ ขอบคุณมากครับ