hi to all experts,
I wrote a macro code, i got stuck in between as i am trying to import multiple excel workbooks variious sheets into an active worksheet.
Requsting you to revert where i am going wrong.
Sub ImportFile()
Dim Str1 As String
Dim i As Integer
Dim j As Long
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = True
.Filters.Add "Excel Files", "*.xls", 1
.Show
.Filters.Add "Allfiles (*.*)", "*.*"
.Show
If .SelectedItems.Count > 0 Then
Worksheets(1).Activate
j = 1
For i = 1 To .SelectedItems.Count
Str1 = "TEXT;" & .SelectedItems.Item(i)
With ActiveSheet.QueryTables.Add(Connection:=Str1, Destination:=Cells(j, 1))
.xlsFileStartRow = 1
.Refresh BackgroundQuery:=False
End With
Next
End If
End With
End Sub