L
Luke
I'm trying to find out why this code is not working.
With Worksheets("Multi-period Code data").ListBox1
.Clear
For FillCount = 1 To Worksheets("ClassCodes").Range("E1")
.AddItem
Worksheets("ClassCodes").Range("C1").Offset(FillCount, 0)
Next FillCount
.ListIndex = Worksheets("Multi-period Code data").Range("O1").Value
End With
Just to clarify, there is a sheet named "Multi-period Code data" and
ListBox1 exists on the sheet. The error appears to be at the initial "With"
statement. I've tried changing it by moving the ".ListBox1" off the first
line and placing it appropriately within the code, but I keep getting
run-time error 438 as soon as it sees the "With" statement.
How can I make this work?
With Worksheets("Multi-period Code data").ListBox1
.Clear
For FillCount = 1 To Worksheets("ClassCodes").Range("E1")
.AddItem
Worksheets("ClassCodes").Range("C1").Offset(FillCount, 0)
Next FillCount
.ListIndex = Worksheets("Multi-period Code data").Range("O1").Value
End With
Just to clarify, there is a sheet named "Multi-period Code data" and
ListBox1 exists on the sheet. The error appears to be at the initial "With"
statement. I've tried changing it by moving the ".ListBox1" off the first
line and placing it appropriately within the code, but I keep getting
run-time error 438 as soon as it sees the "With" statement.
How can I make this work?