(Solved) – How to Tranpose a List Object Header Row for UserForm drop down?

(solved)-–-how-to-tranpose-a-list-object-header-row-for-userform-drop-down?

I want to pull the column headers from a table to use in a drop down in a userform. The number of columns can change and the table may not always start in first row.

Sub DisplayUserFormSplitWb()

UserFormSplitWb.Show

End Sub

Private Sub UserForm_Initialize()
'The following works
'Dim SplitOptions As Range
'Set SplitOptions = ActiveSheet.Range("A1", ActiveSheet.Range("A1").End(xlToRight))

'BELOW DOES NOT WORK
SplitOptions = ActiveSheet.ListObjects(1).HeaderRowRange

SplitWbCol.List = Application.Transpose(SplitOptions.Value)

End Sub

Private Sub BtnOK_Click()

UserFormSplitWb.Hide

Call SplitWbMaster.SplitWbToFiles

End Sub

On code line UserFormSplitWb.Show I get the following:

“Run-time error ‘424’:

Object required”

Leave a Reply

Your email address will not be published. Required fields are marked *