Hi,
I am facing a run-time error when I run my VBA to collect user data in 52 text boxes thru loop code. Apart from set of 52 boxes, I have 2 more sets of 52 txtboxs however they are enabled false and used to show % & other calc based on txtbox in 1st set.
When I run the VBA and start loop to collect data and store it in txtbox, the code gives run-time error at 42nd loop. It works fine till 41st iteration.
I am facing a run-time error when I run my VBA to collect user data in 52 text boxes thru loop code. Apart from set of 52 boxes, I have 2 more sets of 52 txtboxs however they are enabled false and used to show % & other calc based on txtbox in 1st set.
When I run the VBA and start loop to collect data and store it in txtbox, the code gives run-time error at 42nd loop. It works fine till 41st iteration.
Code:
Private Sub Calculate Sum()
Dim Grandtot as Long
Grandtot = 0
Dim i as long
For i=1 to 52
landingpageForm1.TextBox150.Value = landingpageForm1.TextBox150.Value + _
Val(landingpageForm1.Controls("TextBox" & i).Value)
Next
End Sub
Private Sub userform_clikc()
TextBox1.Value = ""
.
.
.
.
.
.
.
TextBox51.Value = ""
[\Code]