vba 구현 파일 내용 요약

1149 단어 VBA
1. 
     Excel EXCEL 。

2. 
Sub ボタン3_Click()
    Dim dstSheet As Worksheet
    Set dstSheet = ThisWorkbook.Worksheets(1)
    Const Path As String = "D:\ou\Calibration\Result\"
    Dim buf As String
    Dim value As String
    Dim temp() As String
     ' 
    Const prefix = "result_"
    Const center_str = "Yaw"
    
    Const cnsDIR = "\" + prefix + center_str + "*.csv"
    buf = Dir(Path & cnsDIR, vbNormal)
    
    Dim i As Long
    Do While buf <> ""
        i = i + 1
        Dim srcBook As Workbook
        Set srcBook = Workbooks.Open(Path + buf)
        Dim srcSheet As Worksheet
        Set srcSheet = srcBook.Worksheets(1)
        dstSheet.Cells(10, i).value = srcSheet.Cells(1, 1)
        srcBook.Close False
        'ファイル を 
        temp = Split(buf, "_")
        value = Mid(temp(1), Len(center_str) + 1, Len(temp(1)) - Len(center_str) - 4)
        dstSheet.Cells(9, i).value = value
        buf = Dir()
       
    Loop

End Sub

좋은 웹페이지 즐겨찾기