Userform Disaster in VBA excel:-(

alliet

New member
Joined
Aug 4, 2013
Messages
5
Reaction score
0
Points
0
Hi everyone, I really hope someone would kindly guide me in my first attempt at using VBA. I've created a userform with multipages, my form originally loaded up from excel but now it doesn't, my main problem with the multipage is with moving from one page to the next it seems that there are 2 out of the 3 pages that are not working properly and my combo boxes don't work, I've literally gone through about 10 help videos, gone through online notes and I can't seem to get it working. With the exception of my schedule repair button the other forms don't appear to load up. I don't want to give up but I desperately need to get the form up and running. I would appreciate your help please. thx you in advance (thanks to Roy for helping me earlier in the week, I think I fixed that problem but then created another one for myself by deciding to change the userform)
 

Attachments

  • reg v2.xlsm
    76.9 KB · Views: 28
Your code uses Named Ranges to populate ComboBoxes, there are no named ranges in that workbook.

Looping through a Range to populate the ComboBox is inefficient and using the List property of the combobox would be better.
 
Code to populate ComboBoxes
Code:
Private Sub UserForm_Initialize()




    Dim WS As Worksheet
    Set WS = Worksheets("lookuplists")


    With WS.Cells(1, 1).CurrentRegion
        Me.cbocategory.List = .Columns(1).Value
        Me.cboassettype.List = .Columns(2).Value
        Me.cbopurchasetype.List = .Columns(3).Value
        Me.cbolocation.List = .Columns(4).Value
    End With


End Sub

This fixes one problem but there are missing controls or wrong names of controls in the code. Try debugging the code 7 these errors will be highlighted in yellow
 
Back
Top