Problem populating listbox

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Please consider this piece of code ...

Rich (BB code):
Workbooks("Sports17.xlsm").Names.Add Name:="missing_all", RefersTo:=temp_ws.Range(temp_ws.Cells(rw_pr_start, 13), temp_ws.Cells(rw_pr_end, 16))
        
        
            With uf2_assess_sched
                .uf1_tb7.Value = ar
                .uf1_tb8.Value = pr
                .uf1_tb7.Locked = True
                .uf1_tb8.Locked = True
                .uf1_tb7.ForeColor = RGB(0, 52, 89)
                .uf1_tb8.ForeColor = RGB(0, 52, 89)
                If ar = 0 Then
                    .uf1_active.Value = False
                    .uf1_active.Locked = True
                Else
                    .uf1_active.Value = True
                    .uf1_active.Locked = False
                End If
                If pr = 0 Then
                    .uf1_passive.Value = False
                    .uf1_passive.Locked = True
                Else
                    .uf1_passive.Value = True
                    .uf1_passive.Locked = False
                End If
                With .uf1_listbox3
                    .Clear
                    .ForeColor = RGB(0, 52, 89)
                    .ColumnCount = 4
                    .ColumnWidths = "30;100;80;95"
                    .List = Range("missing_all").Value
                    .ListStyle = fmListStyleOption
                    '.Locked = True
                    .MultiSelect = fmMultiSelectSingle
                End With
            End With

temp_ws has been previously defined and set as a worksheet. The line in red creates a named range in workbook sports17.xlsm consisting of a range between M1 (rw_pr_start, 13), and P28 (rw_pr_end, 16) of worksheet ws_temp

The line in green is supposed to populate uf1_listbox3 with the 4 columns of data captured in the named range.

But the listbox is empty when it reaches the code. There are no errors. When I look up named range "missing_all" in sports17's name manager, the value is correct, and the reference is correct.

Is anyone able to help me correct this problem?
 
Hello guys,

Norie, I have tried your suggestion. It populates the new listbox, uf2_mrexcel, but still not uf2_listbox3. There is something amiss with the control I think. But I have no idea. the text is coloured, so it's not like its "invisible".
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
So, I have determined that what ever the cause of this issue is a result of something done earlier. But I don't know what. After changing all the references of uf2_textbox 3 to uf2_mrexcel in my entire project, uf2_mrexcel no longer populates. It's in the same state as the original.

Is there any suggestion on what I can look for when I step through my code that may create this type of behaviour?
 
Upvote 0

Forum statistics

Threads
1,223,268
Messages
6,171,100
Members
452,379
Latest member
IainTru

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