The Error Says
Run-time error 13 Type Mismatch
Every time I add this to user form. Any ideas why?
I've set it up as a module then called it in to the UserForm_Initialize then it shows an error and won't open the Userform I am trying to add headers & controls to the Listbox Quote Details List
Sub Fill_Quote_Detail() Dim QDetails As ListBox Set QDetails = Body_And_Vehicle_Type_Form.Quote_Details With QDetails Dim ws As Worksheet Dim RngData As Range Set ws = Sheets("Quote Detail") Set RngData = ws.Range("A1:K" & ws.Range("A" & ws.Rows.Count).End(xlUp).Row) QDetails.ColumnHeads = True QDetails.ColumnCount = RngData.Columns.Count Set RngData = RngData.Resize(RngData.Rows.Count - 1).Offset(1) QDetails.RowSource = RngData / Parent.Name & "!" & RngData.Address QDetails.ColumnWidths = "90;60;100;150;90;80;100;95;60" End With End Sub
Initialize(andActivate) events of your form. The error is most likely there. If you're working with forms/classes, you should set the error handling in the VBE to 'Break in class module'.=Me.Quote_DetailsQDetails.RowSource = RngData / Parent.Name & "!" & RngData.Addressshould result with an error, try QDetails.RowSource = RngData.Parent.Name & "!" & RngData.Address