EXCEL TOOLS
Excel Add-ins ที่พัฒนาโดยคุณสันติพงศ์ ณสุย (MVP Excel 2010-2020) ด้วยภาษา C# เพื่อแก้ไขปัญหาไฟล์ใหญ่ คำนวณนาน ทำงานช้า จัดการข้อมูลต่าง ๆ ที่ทำงานประจำวันได้อย่างสะดวกรวดเร็ว สนใจคลิกไปดูได้ที่นี่ครับ => Excel Tools
Excel Add-ins ที่พัฒนาโดยคุณสันติพงศ์ ณสุย (MVP Excel 2010-2020) ด้วยภาษา C# เพื่อแก้ไขปัญหาไฟล์ใหญ่ คำนวณนาน ทำงานช้า จัดการข้อมูลต่าง ๆ ที่ทำงานประจำวันได้อย่างสะดวกรวดเร็ว สนใจคลิกไปดูได้ที่นี่ครับ => Excel Tools
[code]
และปิดด้วย [/code]
ตัวอย่างเช่น [code]dim r as range[/code]
เพื่อให้แตกต่างจากข้อความทั่วไป สะดวกในการอ่านและทดสอบ (คลิกเพื่อดูตัวอย่าง)Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Message, Message1, Title, Title1, msg1, msg2 As Variant
Message = "¡ÃسҢÍ͹ØÒµÔ¨Ò¡ ¼¨¡. áÅÐãÊè Password"
Message1 = "ãÊèÀÒÉÕÁÙŤèÒà¾ÔèÁ"
Title = "Password"
Title1 = "VAT"
Default1 = ""
If Target.Address = Range("a1").Address Then
If Range("a1").Value <> 7 Then
msg1 = InputBox(Message, Title)
If msg1 = 1234 Then
msg2 = InputBox(Message1, Title1)
Range("a1").Value = msg2
Else
MsgBox "¤Ø³ãÊè Password ¼Ô´"
Range("a1").Value = 7
End If
End If
End If
Exit Sub
End Sub
Code: Select all
'Other code
If Target.Address = Range("a1").Address Then
If Range("a1").Value <> 7 Then
msg1 = InputBox(Message, Title)
If msg1 = 1234 Then
Application.EnableEvents = False
msg2 = InputBox(Message1, Title1)
Range("a1").Value = msg2
Application.EnableEvents = True
Else
MsgBox "คุณใส่ Password ผิด"
Range("a1").Value = 7
End If
End If
End If
'Other code
Application.EnableEvents = False และ Application.EnableEvents = True
Code: Select all
'Other code
If Target.Address = Range("a1").Address Then
If Range("a1").Value <> "7%" Then
msg1 = InputBox(Message, Title)
If msg1 = 1234 Then
Application.EnableEvents = False
msg2 = InputBox(Message1, Title1)
Range("a1").Value = msg2
Application.EnableEvents = True
Else
MsgBox "คุณใส่ Password ผิด"
Range("a1").Value = "7%"
End If
End If
End If
'Other code
Code: Select all
If Target.Address = Range("a1").Address Then
If Range("a1").Value / 100 <> "7%" Then
msg1 = InputBox(Message, Title)
If msg1 = 1234 Then
Application.EnableEvents = False
msg2 = InputBox(Message1, Title1)
Range("a1").Value = msg2 / 100
Application.EnableEvents = True
Else
MsgBox "¤Ø³ãÊè Password ¼Ô´"
Range("a1").Value = Range("a1").Value / 100
End If
End If
End If
Code: Select all
If Target.Address = Range("a1").Address Then
If Range("a1").Value <> 0.07 Then
msg1 = InputBox(Message, Title)
Application.EnableEvents = False
If msg1 = 1234 Then
msg2 = InputBox(Message1, Title1)
Range("a1").Value = msg2 / 100
Else
MsgBox "คุณใส่ Password ผิด"
Range("a1").Value = Range("a1").Value / 100
End If
Application.EnableEvents = True
End If
End If
MsgBox "คุณใส่ Password ผิด"
Range("a1").Value = Range("a1").Value / 100
MsgBox "คุณใส่ Password ผิด"
Range("a1").Value = 0.07