Sorry about that!
Here is what I have so far (gleaned from pouring through newsgroups):
Sub Compile()
Dim basebook As Workbook
Dim mybook As Workbook
Dim sourceRange As Range
Dim destrange As Range
Dim rnum As Long
Dim SourceRcount As Long
Dim FNames As String
Dim MyPath As String
Dim SaveDriveDir As String
SaveDriveDir = CurDir
MyPath = "C:\Documents and Settings\rspidle\Desktop\CNA Survey"
ChDrive MyPath
ChDir MyPath
FNames = Dir("*.xls")
If Len(FNames) = 0 Then
MsgBox "No files in the Directory"
ChDrive SaveDriveDir
ChDir SaveDriveDir
Exit Sub
End If
Application.ScreenUpdating = False
Set basebook = ThisWorkbook
basebook.Worksheets(1).Cells.Clear
'clear all cells on the first sheet
rnum = 1
Do While FNames <> ""
If LCase(Left(FNames, 4)) <> "survey" Then
Set mybook = Workbooks.Open(FNames)
Set sourceRange = mybook.Worksheets(1).Range("I1:I140")
SourceRcount = sourceRange.Rows.Count
Set destrange = basebook.Worksheets(1).Cells(rnum, 1)
' basebook.Worksheets(1).Cells(rnum, "D").Value =
mybook.Name
' This will add the workbook name in column D if you want
sourceRange.Copy destrange
'Instead of this line you can use the code below to copy
only the values
' With sourceRange
' Set destrange = basebook.Worksheets(1).Cells(rnum,
"A"). _
' Resize(.Rows.Count,
..Columns.Count)
' End With
' destrange.Value = sourceRange.Value
rnum = rnum + SourceRcount
mybook.Close False
End If
FNames = Dir()
Loop
ChDrive SaveDriveDir
ChDir SaveDriveDir
Application.ScreenUpdating = True
End Sub
What I get with this is all of the data copied over... but all of it
copied into Column A and I need it copied into subsequent columns
(think N+1).
Rob