วันอังคารที่ 24 ธันวาคม พ.ศ. 2562

สอน Function IF อย่างละเอียดตั้งแต่ Worksheet ถึง VBA Part3 การใช้ If ใน...



Part3

สอน Function IF อย่างละเอียดตั้งแต่ Worksheet ถึง VBA Part3 การใช้ If ใน Excel VBA

หลักการเขียน Code VBA   Function IF

If ... Then

...

End If

หลักการเขียน Code VBA  function If เบื้องต้น ตัวอย่าง การตัดสินใจ Go home Vs Other place

การเพิ่มตัวหนังสือ font ใน VBA Editor

ตัวอย่างการเขียน Code Excel VBA ตาม Flow Chart

หลักการเขียน Code VBA  Function IF

If ... Then

...

Else

...

End if

หลักการเขียน Code VBA  function If เบื้องต้น ตัวอย่าง การตัดเกรด Passed/Failed








หลักการเขียน Code VBA  function If เบื้องต้น ตัวอย่าง การตัดสินใจ Go home Vs Other place

'Code

Sub DicisionGoHome3()



Dim strDicide As String



'strDicide = "Market"

strDicide = "Go Home"



If strDicide = "Go Home" Then



    MsgBox "Turn Left"

   

Else



    MsgBox "Turn Right"

   

End If



End Sub



หลักการเขียน Code VBA  function If เบื้องต้น ตัวอย่าง การตัดเกรด Passed/Failed

'Code

Sub Grade_Result()



Dim dPoint As Double



'dPoint = 50

'dPoint = 51.5

dPoint = 48



If dPoint >= 50 Then

   

    MsgBox "Passed"

   

Else



    MsgBox "Failed"

   

End If



End Sub



ไม่มีความคิดเห็น:

แสดงความคิดเห็น

Excel worksheet formular cut number from text

Excel worksheet formula cut number from text