jbennett01
New Member
- Joined
- Apr 25, 2018
- Messages
- 9
How can I get this ListBox to display the states in 2 columns. I've tried a few different things, including modifying the ListBox properties, tried in code. The solutions I've found online all deal with a dynamic array and I could not figure out how to convert that to a static one. This is code from the Form object and the code which calls the Form.
VBA Code:
Private Sub UserForm_Initialize()
' Declare variables
lstStateCodes1 = Array("AK", "AL", "AR", "AZ", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "IA", "ID", "IL", "IN", "KS", _
"KY", "LA", "MA", "MD", "ME", "MI", "MN", "MO")
lstStateCodes2 = Array("MS", "MT", "NC", "ND", "NE", "NH", "NJ", "NM", "NV", "NY", "OH", "OK", "OR", _
"PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VA", "VI", "VT", "WA", "WI", "WV", "WY")
With Me.lstStateList
.ColumnCount = 2
.ColumnWidths = 50
.List(1, 0) = lstStateCodes1
.List(2, 0) = lstStateCodes2
End With
lstForeclosureType = Array("Judicial", "Non Judicial")
lstOccupancyStatus = Array("Abandoned", "Occupied By Unknown", "Owner Occupied", "Removed or Destroyed", "Tenant Occupied", "Unknown", "Vacant")
lstFCLStatus = Array("Active", "Inactive", "On Hold")
End Sub
Code:
sub test ()
Dim frmReport As New frmManualUploadReport
Load frmReport
frmReport.Show
Unload frmReport
End Sub