สอบถามตัวแปรในโค๊ดนี้ครับ
Posted: Fri Apr 05, 2013 9:24 pm
Code: Select all
Sub UpDate_Meal_Accom()
Application.Run "UpDate_Meal_Accom_01"
On Error Resume Next
Dim Rx%, rxx%, Cx%
xdate = Worksheets("data").Range("c1") ' Check DATE"
rxx = Format(xdate, "d") ' Rxx = DATE
Rx = 6 ' Row Start Index
Cx = rxx + 2 ' Column Index
For i = Rx To Rx + 43
If Worksheets("Data").Cells(i + 25, 5) = 1 Then
Worksheets("Meal&Accom").Cells(i, Cx).Value = "Erw"
End If
Next i
For i = Rx To Rx + 43
If Worksheets("Data").Cells(i + 25, 5) = 2 Then
Worksheets("Meal&Accom").Cells(i, Cx).Value = "Efso"
End If
Next iโค๊ดนี้ใช้งานเกี่ยวกับการบันทึกข้อมูลของแต่ละคนว่าได้พักที่ไหนบ้างในวันไหนนับ ไปเรื่อยตามวันที่ครับ ส่วนอื่นพอเข้าใจครับ
For i = Rx To Rx + 43 ?
If Worksheets("Data").Cells(i + 25, 5) ?