Hello, i am getting an error, compile error: user defined type not defined
i am not sure why this is happening
getting it in this code at this part of the code:
tblTabsImport As ArrayList
Code below:
i am not sure why this is happening
getting it in this code at this part of the code:
tblTabsImport As ArrayList
Code below:
VBA Code:
Private Sub CommandButton2_Click()
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Application.DisplayAlerts = False
'Getting arrayList of tabs to import
'
'Dim tabsToImport As ArrayList
'Set tabsToImport = New ArrayList
Dim tblTabsImport As ArrayList
Set tblTabsImport = New ArrayList
Dim wb As Workbook
Set wb = Workbooks.Open(fileName:=Me.TextBox1.Text)
Dim i As LongPtr
Dim tempSht As Worksheet
Dim lo As ListObject
For i = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(i) = True Then
tblTabsImport.Add Me.ListBox1.list(i)
End If
Next i
For i = 0 To tblTabsImport.count - 1
wb.Worksheets(tblTabsImport(i)).Copy After:=ThisWorkbook.Worksheets(ThisWorkbook.Worksheets.count)
Next i
On Error Resume Next
ThisWorkbook.ChangeLink Name:=wb.Name, NewName:=ThisWorkbook.Name
On Error GoTo 0
Unload Me
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
Application.DisplayAlerts = True
End Sub