dmqueen
Board Regular
- Joined
- Aug 5, 2014
- Messages
- 53
Good Morning,
I have two listboxes that are dynamically populated at runtime so the user can add items. I want to add an Uppercase converserion to the text before these items are displayed Since the number of items can e different every time. I'm trying to use listbox.Itemscount as my loop max. But I'm receiving an Object required Runtme 424 error on this line. Suggestions?
<code>
Sub Machine_Change()
'for each entry in Machines
'convert it to UPPER CASE
'display in listbox
'save to Machines worksheet
Dim counter As Integer
'next line receives error
For counter = 0 To Machines.Items.Count
Machines.counter = UCase(Machines.counter)
Next counter
End Sub
Sub PressMachine_Change()
'for each entry in PressMachines
'convert it to UPPER CASE
'display in listbox
'save to PressMachines worksheet
Dim counter As Integer
'next line receives error
For counter = 0 To PressMachines.Items.Count
Machines.counter = UCase(PressMachines.counter)
Next counter
End Sub
</code>
I have two listboxes that are dynamically populated at runtime so the user can add items. I want to add an Uppercase converserion to the text before these items are displayed Since the number of items can e different every time. I'm trying to use listbox.Itemscount as my loop max. But I'm receiving an Object required Runtme 424 error on this line. Suggestions?
<code>
Sub Machine_Change()
'for each entry in Machines
'convert it to UPPER CASE
'display in listbox
'save to Machines worksheet
Dim counter As Integer
'next line receives error
For counter = 0 To Machines.Items.Count
Machines.counter = UCase(Machines.counter)
Next counter
End Sub
Sub PressMachine_Change()
'for each entry in PressMachines
'convert it to UPPER CASE
'display in listbox
'save to PressMachines worksheet
Dim counter As Integer
'next line receives error
For counter = 0 To PressMachines.Items.Count
Machines.counter = UCase(PressMachines.counter)
Next counter
End Sub
</code>
Last edited: