Listbox Run-time '380' error

dave8

Active Member
Joined
Jul 8, 2007
Messages
275
I'm trying to add items to a listbox, but get a runtime error on the last item:

Code:
...           
       ListBox2.List(i, 0) = Sheets("Sheet2").Range("B" & r).Value
       ListBox2.List(i, 1) = Sheets("Sheet2").Range("C" & r).Value
       ListBox2.List(i, 2) = Sheets("Sheet2").Range("E" & r).Value
       ListBox2.List(i, 3) = Sheets("Sheet2").Range("F" & r).Value
       ListBox2.List(i, 4) = Sheets("Sheet2").Range("G" & r).Value
       ListBox2.List(i, 5) = Sheets("Sheet2").Range("H" & r).Value
       ListBox2.List(i, 6) = Sheets("Sheet2").Range("J" & r).Value
       ListBox2.List(i, 7) = Sheets("Sheet2").Range("K" & r).Value
       ListBox2.List(i, 8) = Sheets("Sheet2").Range("L" & r).Value
       ListBox2.List(i, 9) = ComboBox2.Value
       ListBox2.List(i, 10) = ComboBox4.Value

How to resolve this?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,216,796
Messages
6,132,742
Members
449,756
Latest member
AdkinsP

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top