Sub go()

Dim i As Integer

    For i = 1 To 500

        If Cells(i, 2) = "" Or Cells(i, 2) = "거래일자" Then

            Rows(i).Select

            Cells(i, 1).Select

            Selection.EntireRow.Delete

        End If

    Next i

End Sub

대학 오기 전에는 VB6이 주력언어..라기보단 유일하게 할 줄 아는 언어였는데 이젠 다 까먹어간다..ㅠㅠ
은행 거래기록을 xls로 다운로드했는데 자꾸 헤더가 반복되어서 보기 힘들길래 오랜만에 VB코딩.

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