This code works perfectly
except that it puts the calculated value of VISA PLAT Balance into a separate textbox, Textbox2.
How can this code be rewritten so that it includes (or combines) the results of BOTH For-End For calculations into just ONE textbox, Textbox1
on two separate lines ?
Thanks for anyone's help.
cr
Code:
Private Sub UserForm_Initialize()
Dim x As Range
Application.EnableEvents = False
Application.ScreenUpdating = False
Sheets("Budget").Select
For i = colnum + 1 To 54
Cells(30, i).Value = Cells(30, i - 1).Value - Cells(18, i).Value
If Cells(30, i) = 0 Then
TextBox1.Value = "VISA balance is 0 at col " & i & " " & " and week " & Cells(2, i)
Range(Cells(30, i + 1), Cells(30, 105)).ClearContents
Exit For
End If
Next
For i = colnum + 1 To 54
Cells(31, i).Value = Cells(31, i - 1).Value - Cells(25, i).Value
If Cells(31, i) = 0 Then
TextBox2.Value = "VISA PLAT Balance is 0 at col " & i & " and week " & Cells(2, i)
Range(Cells(31, i + 1), Cells(31, 105)).ClearContents
Exit For
End If
Next
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
How can this code be rewritten so that it includes (or combines) the results of BOTH For-End For calculations into just ONE textbox, Textbox1
on two separate lines ?
Thanks for anyone's help.
cr