copying from closed workbook excel VBA
问题 Ok I get to the point where code is reading data from closed workbook and can paste it into sheet2 in that workbook. This is my new code: Sub Copy456() Dim iCol As Long Dim iSht As Long Dim i As Long 'Fpath = "C:\testy" ' change to your directory 'Fname = Dir(Fpath & "*.xlsx") Workbooks.Open ("run1.xlsx") For i = 1 To Worksheets.Count Worksheets(i).Activate ' Loop through columns For iSht = 1 To 6 ' no of sheets For iCol = 1 To 6 ' no of columns With Worksheets(i).Columns(iCol) If ((.Cells(1,