snasui wrote:
ก่อนที่จะถามตอบกันต่อไป ควรแจ้งชื่อหัวข้อที่สื่อถึงปัญหาที่ถามมาก่อน ผมจะได้เปลี่ยนชื่อกระทู้ให้ใหม่ครับ
ขอโทษครับอาจารย์ ผมยังหาที่แก้ไขกระทู้ยังไม่เจอครับ
Code: Select all
Private Sub CommandButton1_Click()
ActiveSheet.Unprotect Password:="Che061"
Sheets("Bill_WH").Select
ActiveSheet.Unprotect Password:="Che061"
Dim LastRow As Object
Set LastRow = Sheet1.Range("C11").End(xlUp)
LastRow.Offset(1, 0).Value = TextBox1.Text
LastRow.Offset(1, 5).Value = TextBox2.Text
LastRow.Offset(1, 6).Value = TextBox3.Text
MsgBox "¤Ø³ä´é·ÓÃÒ¡ÒÃáÅéÇ"
response = MsgBox("¤Ø³µéͧ¡Ò÷ÓÃÒ¡ÒõèÍä»?", _
vbYesNo)
If response = vbYes Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox1.SetFocus
Else
Unload Me
End If
ActiveSheet.Protect Password:="Che061", DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows _
:=True, AllowInsertingHyperlinks:=True, AllowDeletingColumns:=True, _
AllowDeletingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
AllowUsingPivotTables:=True
End Sub
หากตรงไหนผิดพลาดขออภัยด้วยครับ
ทดสอบ.xlsm
Password: Che061 ทุกอันครับเว้นแต่ตอนเข้า ไม่ต้องใส่อะไรครับ
You do not have the required permissions to view the files attached to this post.