Source : http://www.oaultimate.com/office/merge-multiple-excel-files-into-a-single-spreadsheet-ms-excel-2007.html
Sub mergeExcel()
    Dim bookList As Workbook
    Dim mergeObj As Object, dirObj As Object, filesObj As Object, everyObj As Object
        Application.ScreenUpdating = False
        Set mergeObj = CreateObject("Scripting.FileSystemObject")
 
        'change folder path of excel files here
        Set dirObj = mergeObj.Getfolder("D:\change\to\excel\files\path\here")
        Set filesObj = dirObj.Files
        For Each everyObj In filesObj
            Set bookList = Workbooks.Open(everyObj)
     
            Range("A2:F27" & Range("A65536").End(xlUp).Row).Copy
            ThisWorkbook.Worksheets(1).Activate


            Range("A65536").End(xlUp).Offset(1, 0).PasteSpecial
            Application.CutCopyMode = False
            bookList.Close
        Next
End Sub



'Computer' 카테고리의 다른 글

서시(서C)  (0) 2014.05.25
Javascript Variable Scope : Closure  (0) 2014.03.25
ubuntu에서 PHP 사용시 curl이 없을 경우  (0) 2014.02.25
[VIM] Back Reference  (0) 2014.02.06
문제 다 틀리고 방1등...?!  (0) 2014.01.29
sudo apt-get install php5-curl


'Computer' 카테고리의 다른 글

Javascript Variable Scope : Closure  (0) 2014.03.25
Merge multiple excel documents into one sheet  (0) 2014.03.12
[VIM] Back Reference  (0) 2014.02.06
문제 다 틀리고 방1등...?!  (0) 2014.01.29
When WebSocket is Imediately Closed..  (0) 2013.12.25

Replacement Part of :substitute

Replacement part of the S&R has its own special characters which we are going to use to fix grammar:

#
Meaning
#
Meaning
&
the whole matched pattern
\L
the following characters are made lowercase
\0
the whole matched pattern
\U
the following characters are made uppercase
\1
the matched pattern in the first pair of \(\)
\E
end of \U and \L
\2
the matched pattern in the second pair of \(\)
\e
end of \U and \L
...
...
\r
split line in two at this point
\9
the matched pattern in the ninth pair of \(\)
\l
next character made lowercase
~
the previous substitute string
\u
next character made uppercase

Now the full S&R to correct non-capital words at the beginning of the sentences looks like

s:\([.!?]\)\s\+\([a-z]\):\1  \u\2:g

We have corrected our grammar and as an extra job we replaced variable number of spaces between punctuation and the first letter of the next sentence with exactly two spaces.


http://vimregex.com/#backreferences