Hi,
Sorry i did not get you at the first time. I think i have got it this time !
Here is one dirty way of doing it!!
VB Code:
Option Explicit Private Sub Text1_Change(Index As Integer) Dim T(4) As Double T(0) = Val(Replace(Text1(0).Text, ",", "", , , vbBinaryCompare)) T(1) = Val(Replace(Text1(1).Text, ",", "", , , vbBinaryCompare)) T(2) = Val(Replace(Text1(2).Text, ",", "", , , vbBinaryCompare)) T(3) = Val(Replace(Text1(3).Text, ",", "", , , vbBinaryCompare)) T(4) = Val(Replace(Text1(4).Text, ",", "", , , vbBinaryCompare)) Select Case Index Case 0 Text1(2).Text = Format(T(0) + T(1), "#,##0.00") Case 3 Text1(4).Text = Format(T(2) + T(3), "#,##0.00") End Select End Sub Private Sub Text1_LostFocus(Index As Integer) Text1(Index).Text = Format(Text1(Index).Text, "#,##0.00") End Sub
Is this what you are looking for? Let me know





Reply With Quote