PKennedyG77
New Member
- Joined
- Jan 2, 2016
- Messages
- 22
- Office Version
- 365
- Platform
- Windows
Hi,
Absolute amateur here.
I have created a form to allow information to be entered that will be put into a spreadsheet.
I am trying to loop through the comboboxes on the form to have the values assigned to a variable
Code is
Private Sub Cmdenter_Click()
Dim theDate As Date
Dim Member(1 To 50) As String
Dim MoneyIn(1 To 50) As Single
Dim c As Integer
TxtDate.Value = Format(TxtDate.Value, "dd-mm-yy")
theDate = TxtDate.Value
For c = 1 To 50
Member(c) = cboMember(c).Value
MoneyIn(c) = TxtMoneyIn(c).Value
MsgBox Member(c)
MsgBox MoneyIn(c)
Next c
End Sub
Getting an error on the combobox when running this.
No doubt something simple but cannot fix this.
Absolute amateur here.
I have created a form to allow information to be entered that will be put into a spreadsheet.
I am trying to loop through the comboboxes on the form to have the values assigned to a variable
Code is
Private Sub Cmdenter_Click()
Dim theDate As Date
Dim Member(1 To 50) As String
Dim MoneyIn(1 To 50) As Single
Dim c As Integer
TxtDate.Value = Format(TxtDate.Value, "dd-mm-yy")
theDate = TxtDate.Value
For c = 1 To 50
Member(c) = cboMember(c).Value
MoneyIn(c) = TxtMoneyIn(c).Value
MsgBox Member(c)
MsgBox MoneyIn(c)
Next c
End Sub
Getting an error on the combobox when running this.
No doubt something simple but cannot fix this.