L
lucky9999b
What i'm trying to do is the following:
If 2 criteria are met go trough all "TextBoxW" & i and check that there
value is not "". If they are not blank i want to perform an action whith this
value.
I have 53 TextBoxW so i could make an if function for each textbox but i'm
looking for some sorther code. Anyone any idea's?
Here is what i tried but didn't work since i can't extract a value out a
control or is there an other way?
Dim ctlWork As Control
Dim i As Integer
Dim ctlName As String
Sheets("RawData").Select
Dim Result As Integer
If ComboBoxAction = "Gratis" Or CommandButtonUpdate = True Then
i = TextBoxVanW.Value - 1
Do
i = i + 1
ctlName = "TextBoxW" & i
For Each ctlWork In UserForm.Controls
If ctlWork.Name = ctlName And ctlWork.value <> "" Then
Result = ctlWork.value + Cells(2, 3+i).value
End If
Next
Loop While i < TextBoxTotW.Value
End If
Sheets("RawData").Select
If ComboBoxAction = "Gratis" Or CommandButtonUpdate = True Then
i = TextBoxVanW.Value - 1
Do
i = i + 1
ctlName = "TextBoxW" & i
For Each ctlWork In UserForm.Controls
If ctlWork.Name = ctlName And GetValue(ctlWork) <> "" Then
End If
Next
Loop While i < TextBoxTotW.Value
End If
If 2 criteria are met go trough all "TextBoxW" & i and check that there
value is not "". If they are not blank i want to perform an action whith this
value.
I have 53 TextBoxW so i could make an if function for each textbox but i'm
looking for some sorther code. Anyone any idea's?
Here is what i tried but didn't work since i can't extract a value out a
control or is there an other way?
Dim ctlWork As Control
Dim i As Integer
Dim ctlName As String
Sheets("RawData").Select
Dim Result As Integer
If ComboBoxAction = "Gratis" Or CommandButtonUpdate = True Then
i = TextBoxVanW.Value - 1
Do
i = i + 1
ctlName = "TextBoxW" & i
For Each ctlWork In UserForm.Controls
If ctlWork.Name = ctlName And ctlWork.value <> "" Then
Result = ctlWork.value + Cells(2, 3+i).value
End If
Next
Loop While i < TextBoxTotW.Value
End If
Sheets("RawData").Select
If ComboBoxAction = "Gratis" Or CommandButtonUpdate = True Then
i = TextBoxVanW.Value - 1
Do
i = i + 1
ctlName = "TextBoxW" & i
For Each ctlWork In UserForm.Controls
If ctlWork.Name = ctlName And GetValue(ctlWork) <> "" Then
End If
Next
Loop While i < TextBoxTotW.Value
End If