สอบถามการเช็ตค่าว่างแล้วโชว์ Msgbox ตามเซลล์นั้นๆครับ
Posted: Wed Feb 14, 2018 11:15 am
ผมจะเช็คว่า Cell ไหนไม่มีค่าแล้วให้โชว์ Msgbox "ERROR + Cell name นั้นๆ" ปัจจุบันผม ใช้ if ทั้งหมด 365 วัน ครับช่วยแนะนำให้ลดปริมาณการใช้ IF หน่อยครับ
Sub check_Data()
Dim OutPut As Integer
If Sheet1.Range("B2").Value <> "OK" Then
OutPut = MsgBox("ERROR DAY1")
End If
If Sheet1.Range("C2").Value <> "OK" Then
OutPut = MsgBox("ERROR DAY2")
End If
End Sub
Sub check_Data()
Dim OutPut As Integer
If Sheet1.Range("B2").Value <> "OK" Then
OutPut = MsgBox("ERROR DAY1")
End If
If Sheet1.Range("C2").Value <> "OK" Then
OutPut = MsgBox("ERROR DAY2")
End If
End Sub