- Selva V Pasupathy, HSBC Global Resourcing, Hyderabad
|
Option Explicit ‘___________________________________________________________________________ ‘*************************************************************************** ‘* ‘* MODULE NAME: Copy Data from all Excel Files in a Folder ‘* AUTHOR: Selva V Pasupathy, HSBC Global Resourcing, Hyderabad ‘* ‘* CONTACT: socko@rediffmail.com ‘* WEB SITE: http://socko.wordpress.com ‘* ‘* DESCRIPTION: The following visual basic code was written when ‘* I wanted to consolidate the data from 26 workbooks ‘* and in each workbook, there were are 77 sheets. It ‘* would have been a very difficult task, if I had to ‘* do it manually. I believe this procedure will be ‘* useful to somebody else ‘* NOTES: ‘* Before using the codes, you can change all the variables like, ‘* Folder, File , SearchString, SearchSubfolders (true / false), ‘* and other variables. ‘*———————————————————————— ‘* Other Information ‘* ‘* UPDATES: ‘* DATE COMMENTS ‘* 16 Nov 2008 You are free to use , change, and modify this code. ‘___________________________________________________________________________ ‘*************************************************************************** Function ListFiles(sCount As Integer, ByVal sFldr As String, _ With Application.FileSearch End Function Sub Consolidate_Data() myFolder = “J:\GB Project\CONSOLIDATED” With ThisWorkbook.Sheets(“data”) |