D
diepvic
Hi,
My below code has a compile error : Expected: list seperator or )
Pls help solve it.
Sub Consolidation()
'Copy to the next line in the target file'
Dim i As Integer, wb As Workbook
Dim first, last As Long
'Open all files in the folder'
With Application.FileSearch
.NewSearch
.LookIn = "N:\Tax\FILE1"
.SearchSubFolders = False
.Filename = "*.xls"
.Execute
For i = 1 To .FoundFiles.Count
'Open each workbook
Set wb = Workbooks.Open(Filename:=.FoundFiles(i))
'Identify 1st row & last row of the target area'
first = ActiveSheet.Cells(Rows.Count, "C").End(xlDown).Row
first = first - 1
last = ActiveSheet.Cells(Rows.Count, "C").End(xlUp).Row
Range("A" & first&":H" & last).Copy ======>
error in here
'On to the next workbook
Next i
End With
End Sub
My below code has a compile error : Expected: list seperator or )
Pls help solve it.
Sub Consolidation()
'Copy to the next line in the target file'
Dim i As Integer, wb As Workbook
Dim first, last As Long
'Open all files in the folder'
With Application.FileSearch
.NewSearch
.LookIn = "N:\Tax\FILE1"
.SearchSubFolders = False
.Filename = "*.xls"
.Execute
For i = 1 To .FoundFiles.Count
'Open each workbook
Set wb = Workbooks.Open(Filename:=.FoundFiles(i))
'Identify 1st row & last row of the target area'
first = ActiveSheet.Cells(Rows.Count, "C").End(xlDown).Row
first = first - 1
last = ActiveSheet.Cells(Rows.Count, "C").End(xlUp).Row
Range("A" & first&":H" & last).Copy ======>
error in here
'On to the next workbook
Next i
End With
End Sub