ต้องการให้เวลากดบันทึกแล้ว ลำดับที่ รันอัตโนมัติ
Posted: Fri Sep 11, 2020 3:54 pm
Code: Select all
lastrow = Worksheets("ÊÒÃÁҵðҹ").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("ÊÒÃÁҵðҹ").Cells(lastrow + 1, 1).Value = TOrder.Text
Worksheets("ÊÒÃÁҵðҹ").Cells(lastrow + 1, 2).Value = TList.Text
Worksheets("ÊÒÃÁҵðҹ").Cells(lastrow + 1, 3).Value = TMolcular.Text
Worksheets("ÊÒÃÁҵðҹ").Cells(lastrow + 1, 4).Value = ComGrade.Text
Worksheets("ÊÒÃÁҵðҹ").Cells(lastrow + 1, 5).Value = TPurity.Text
Worksheets("ÊÒÃÁҵðҹ").Cells(lastrow + 1, 6).Value = TCasNo.Text
Worksheets("ÊÒÃÁҵðҹ").Cells(lastrow + 1, 7).Value = TBottle.Text
Worksheets("ÊÒÃÁҵðҹ").Cells(lastrow + 1, 8).Value = TLot.Text
Worksheets("ÊÒÃÁҵðҹ").Cells(lastrow + 1, 9).Value = ComCompany.Text
Worksheets("ÊÒÃÁҵðҹ").Cells(lastrow + 1, 10).Value = TSize.Text
Worksheets("ÊÒÃÁҵðҹ").Cells(lastrow + 1, 11).Value = TTemperature.Text
Worksheets("ÊÒÃÁҵðҹ").Cells(lastrow + 1, 12).Value = TInputday.Text
Worksheets("ÊÒÃÁҵðҹ").Cells(lastrow + 1, 13).Value = TOutputday.Text
Worksheets("ÊÒÃÁҵðҹ").Cells(lastrow + 1, 15).Value = TExpire.Text
Worksheets("ÊÒÃÁҵðҹ").Cells(lastrow + 1, 16).Value = TStatus.Text
Worksheets("ÊÒÃÁҵðҹ").Cells(lastrow + 1, 17).Value = ComType.Text
Worksheets("ÊÒÃÁҵðҹ").Cells(lastrow + 1, 18).Value = TCoa.Text
Dim i As Long
On Error Resume Next
i = Application.WorksheetFunction.CountA(Sheet1.Range("B:B"))
If i > 1 Then
Sheet1.Range("A" & i).Value = i - 1
End If
TOrder.Value = " "
TList.Value = " "
TMolcular.Value = " "
ComGrade.Value = " "
TPurity.Value = " "
TCasNo.Value = " "
TBottle.Value = " "
TLot.Value = " "
ComCompany.Value = " "
TSize.Value = " "
TTemperature.Value = " "
TInputday.Value = " "
TExpire.Value = " "
TStatus.Value = " "
ComType.Value = " "
TCoa.Value = " "