Page 1 of 1

กดบันทึกแล้ว ข้อมูลที่กรอกลงอยู่แทนที่ ซ้ำๆ Row3 ตลอดเลยครับ

Posted: Thu Sep 28, 2023 11:32 am
by SuminO

Code: Select all

Sub create_customrt()
Dim r2 As Integer

r2 = WorksheetFunction.CountA(Sheets("customrt").Range("A:A")) + 1

If category = "¢ÒÂ" And total < Sheets("Input_Customer").Range("C9") Then
    MsgBox "ÊÔ¹¤éÒÁըӹǹäÁè¾Í¢ÒÂ"
Else
    Sheets("customrt").Range("A" & r2) = r2 - 1
    Sheets("customrt").Range("B" & r2) = Date & " " & Time
    Sheets("customrt").Range("C" & r2) = Sheets("Input_Customer").Range("B6")
    Sheets("customrt").Range("D" & r2) = Sheets("Input_Customer").Range("B7")
    Sheets("customrt").Range("E" & r2) = Sheets("Input_Customer").Range("B8")
    Sheets("customrt").Range("F" & r2) = Sheets("Input_Customer").Range("B9")
    Sheets("customrt").Range("G" & r2) = Sheets("Input_Customer").Range("B10")
       
        
    Sheets("Input_Customer").Range("B6:B10").ClearContents
End If

End Sub

Re: กดบันทึกแล้ว ข้อมูลที่กรอกลงอยู่แทนที่ ซ้ำๆ Row3 ตลอดเลยครับ

Posted: Thu Sep 28, 2023 3:38 pm
by puriwutpokin
ควรแนบไฟล์ เพื่อเพื่อนสมาชิก จะได้ทดสอบได้ครับ และเข้าใจตรงกันครับ