snasui.com ยินดีต้อนรับ ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ ระบุ Version ของ Excel
Private Sub txtcl_Change()
If txtcl.Value = "" Then Exit Sub
If txtpvcl.Value = "" Then Exit Sub
If CDbl(txtcl.Value) < CDbl(txtpvcl.Value) Then
txtbeforepv = Format(txtbl.Value - txtcl.Value, "###,##0.00")
Else
txtbeforepv = Format(txtbl.Value - txtpvcl.Value, "###,##0.00")
End If
End Sub
Private Sub txtpvcl_Change()
If txtcl.Value = "" Then Exit Sub
If txtpvcl.Value = "" Then Exit Sub
If CDbl(txtpvcl.Value) < CDbl(txtcl.Value) Then
txtbeforepv = Format(txtbl.Value - txtpvcl.Value, "###,##0.00")
Else
txtbeforepv = Format(txtbl.Value - txtcl.Value, "###,##0.00")
End If
End Sub