Hello
The core of the probelm is that I am trying to copy the contents about 65 files from lines 8 and below onto a new summary file. The child file name (from which I copy) will change but will always start with the same word. The size of the child files will vary greatly in length, some will be over 4000 rows long. The part down below is part of a loop that actually works, when the file is "only" about 400 rows long.
I tried using the Windows....Activate function (using the child window name as a variable) to be able to switch back and forth between windows but this didn't work. I also hear that this function represents a big "NoNo" amongst programmers... Any otehr suggestions?
Set WorkBk = Workbooks.Open(FolderPath & FileName)
If Range("A9") <> 0 And Range("A8") <> 0 Then
Rows("8:8").Select
Set SourceRange = WorkBk.Worksheets(1).Range(Selection, Selection.End(xlDown))
Set DestRange = SummarySheet.Range("A" & NRow)
Set DestRange = DestRange.Resize(SourceRange.Rows.Count, _
SourceRange.Columns.Count)
' Copy over the values from the source to the destination.
DestRange.Value = SourceRange.Value
' Increase NRow so that we know where to copy data next.
NRow = NRow + DestRange.Rows.Count
End If
Bookmarks