Excel VBA Crashes during userform initialization - AFTER saving as/re-opening

Photomommie

New Member
Joined
Feb 10, 2019
Messages
2
I have tried extensive searching on this matter and for the life of me, I can't figure out what is causing this crash. It happens after the file is SAVED-AS a new name and opened, when I run the userform macro, it crashes. Any help or ideas would be greatly appreciated!
Code:
Private Sub UserForm_Initialize()
'This section Initializes the form with dropdown entries
Dim xRg As Range
Dim xRg2 As Range
Dim xRg3 As Range
Dim xRg4 As Range
Dim xRg5 As Range
Dim xRg6 As Range
Dim xRg7 As Range
Dim xRg8 As Range
    Set xRg = Worksheets("HELPER").Range("A2:AK35")
    Set xRg2 = Worksheets("KNOBS & LEGS").Range("A2:E700") 'Knobs and Pulls List
    Set xRg3 = Worksheets("KNOBS & LEGS").Range("G2:I75") 'Legs list
    Set xRg4 = Worksheets("DOORS & DRAWERS").Range("A2:I60") 'Doors styles list
    Set xRg5 = Worksheets("DOORS & DRAWERS").Range("G2:I20") 'Drawer style list
    Set xRg6 = Worksheets("KNOBS & LEGS").Range("K2:L35") 'Corbels, Feet and Onlay list
    Set xRg7 = Worksheets("WOOD").Range("A3:AO85") 'Wood finish list
    Set xRg8 = Worksheets("DATA").Range("A2:FA15") 'Data Source
    Me.MultiPage1.Value = 0
'Page 1 Options
    tbxDate.Value = Date
    'START position cursor in this control
    Me.tbxJobNumber.SetFocus
    Me.cboJobNumber2.List = xRg8.Columns(1).Value
    Me.cboSalesAgent.List = xRg.Columns(1).Value
    Me.cboProjectManager.List = xRg.Columns(1).Value
    Me.cboFieldManager.List = xRg.Columns(2).Value
    Me.cboBuilder.List = xRg.Columns(31).Value
    Me.cboSubdivision.List = Worksheets("HELPER").Range("AD2:AD77").Value
    chbxBillingSameYN.Value = True
    tbxBillingCustomer.Visible = False
    tbxBillingAddress.Visible = False
    tbxBillingCityStateZIP.Visible = False
    Label36.Visible = False
    Label35.Visible = False
    Label34.Visible = False
    'Make Date submitted always show today
    Me.tbxDateSubmitted.Value = Date
    Me.cboGarage.AddItem "Left"
    Me.cboGarage.AddItem "Right"
    Me.cboGarage.AddItem "N/A"
'Page 2 - Door Style Page Options
    'List Door/Drawer Styles
    Me.cboUpperDoorStyle.List = xRg4.Columns(1).Value
    Me.cboLowerDoorStyle.List = xRg4.Columns(1).Value
    Me.chbxGlass.Visible = False
    'List Hardware Options
    Me.cboHinge.List = xRg.Columns(5).Value
    Me.cboInterior.List = xRg.Columns(6).Value
    Me.cboCrown.List = xRg.Columns(7).Value
    Me.cboDrawerGuides.List = xRg.Columns(10).Value
    Me.cboDrawerBox.List = xRg.Columns(11).Value
    Me.cboDrawerFront.List = xRg.Columns(13).Value
    Me.cboROT.List = xRg.Columns(8).Value
    Me.cboFingerRout.AddItem "YES"
    Me.cboFingerRout.AddItem "NONE"
    Me.cboLightRail.List = xRg.Columns(17).Value
    Me.cboBottoms.List = xRg.Columns(14).Value
    Me.cboHardware.List = xRg.Columns(12).Value
    'Hide alt upper if same
    chbxUpperSame.Value = False
'Page 3 - Hardware Page Options
    'List Knobs and Pulls
    Me.cboSort.AddItem "Type"
    Me.cboSort.AddItem "Color"
    Me.cboSort.AddItem "Manufacturer"
    Me.cboSort2.AddItem "Type"
    Me.cboSort2.AddItem "Color"
    Me.cboSort2.AddItem "Manufacturer"
    Me.cboSort3.AddItem "Type"
    Me.cboSort3.AddItem "Color"
    Me.cboSort3.AddItem "Manufacturer"
    Me.cboSort4.AddItem "Type"
    Me.cboSort4.AddItem "Color"
    Me.cboSort4.AddItem "Manufacturer"
    Me.cboSort5.AddItem "Type"
    Me.cboSort5.AddItem "Color"
    Me.cboSort5.AddItem "Manufacturer"
    Me.cboSort6.AddItem "Type"
    Me.cboSort6.AddItem "Color"
    Me.cboSort6.AddItem "Manufacturer"
'Application.Wait (Now + TimeValue("0:00:02"))
'Page 4 - Paint and wood species Options
    Me.cboSpecies.List = xRg.Columns(18).Value
    Me.cboFinishName.List = xRg7.Columns(1).Value
    Me.cboModifier1.List = xRg.Columns(23).Value
    Me.cboModifier2.List = xRg.Columns(23).Value
    Me.cboSheen.AddItem "10"
    Me.cboSheen.AddItem "20"
    Me.Label141.Visible = False
    Me.tbxApproval.Visible = False
    Me.cboCounterTop1.List = Worksheets("HELPER").Range("P2:P12").Value
    Me.cboCounterTop2.List = Worksheets("HELPER").Range("P2:P12").Value
    Me.cboCounterTop3.List = Worksheets("HELPER").Range("P2:P12").Value
    Me.cboCounterTop4.List = Worksheets("HELPER").Range("P2:P12").Value
    Me.cboCounterTop5.List = Worksheets("HELPER").Range("P2:P12").Value
    Me.cboCounterTop6.List = Worksheets("HELPER").Range("P2:P12").Value
    Me.cboCounterTop7.List = Worksheets("HELPER").Range("P2:P12").Value
'Page 5 - List Legs & Corbels Options
    Me.cboLegs1.List = xRg3.Columns(1).Value
    Me.cboLegs2.List = xRg3.Columns(1).Value
    Me.cboCorbels.List = xRg6.Columns(1).Value
'Page 6 - Nothing to initialize
'Page 7 - List Appliance Options
    Me.cboAppliance1.List = xRg.Columns(29).Value
    Me.cboAppliance2.List = xRg.Columns(29).Value
    Me.cboAppliance3.List = xRg.Columns(29).Value
    Me.cboAppliance4.List = xRg.Columns(29).Value
    Me.cboAppliance5.List = xRg.Columns(29).Value
    Me.cboAppliance6.List = xRg.Columns(29).Value
    Me.cboAppliance7.List = xRg.Columns(29).Value
    Me.cboAppliance8.List = xRg.Columns(29).Value
    Me.cboAppliance9.List = xRg.Columns(29).Value
    Me.cboAppliance10.List = xRg.Columns(29).Value
    Me.cboAppliance11.List = xRg.Columns(29).Value
End Sub
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,214,830
Messages
6,121,831
Members
449,051
Latest member
excelquestion515

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