Test VBA Code with Thai language component
Posted: Sun Jul 31, 2011 7:06 pm
Code: Select all
Private Sub btnOK_Click()
Dim rs As Range
Dim rt As Range
Dim s As String
s = Application.Text(Date, "dดดดดbb")
With Workbooks("ฐานข้อมูล.xlsx").Worksheets("Temp")
Set rs = .Range("A2", .Range("A" & Rows.Count).End(xlUp).Offset(, 7))
End With
With Workbooks("ฐานข้อมูล.xlsx").Worksheets(s)
Set rt = .Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
End With
rs.Copy
rt.PasteSpecial xlPasteValues
MsgBox "บันทึกรายการอาหารเรียบร้อยแล้ว"
Application.CutCopyMode = False
Unload Me
End Sub