Thread: Creating a loop
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Creating a loop

Already see one goof. Should be For i = 0 To 12 instead of 13.
The array is zero based.

"Jennifer" wrote:

Hi Guys,
Can you help?
I have created this code but I have never created a loop before so I need
some direction:
I have 13 text boxes I need it to check for a value and subtract it from the
'percent'
Thank you, Jennifer

Private Sub GetSum1()
Dim Ration As Variant
Dim Percent As String
With Worksheets("Database")
Ration = txtRFID.Value
'Sheets("Rations").Activate
Percent = WorksheetFunction. _
SumIf(Range("ProduceItemDatabase"), Ration, Range("BxsToMarket"))
If Me.TextBox1 = "" Then
Exit Sub
Else
Me.lblTotal = Percent - TextBox1.Value
End If

End With
End Sub

--
Thank you,

Jennifer