Re: VBA - importing all excel files from subfolders
HI,
When I merge multiple workbooks from different sub folder by using below code, the header gets repeated, e.g column A1 to AQ15. How do I remove the header and merge only the data file.
Sub M_snb() sn=filter(split(Createobject("wscript.shell").exec("cmd /c Dir ""G:\OF\*.xls"" /b/s").stdout.readall,vbcrlf),":")
For j=0 To UBound(sn)
With getobject(sn(j)).sheets(1).usedrange
thisworkbook.sheets(1).cells(rows.count,1).end(xlup).offset(2).resize(.rows.count,.columns.count)=.value
.Parent.parent.close 0
End With
Next
End Sub