Macro help
Im sorry---It appears that it is this line that is the one causing the problem
Range("4:4").SpecialCells(xlCellTypeConstants)
and the values are entered via data validation not a formula if that makes a
difference
Thanks
"Bernie Deitrick" wrote:
Jodi,
The macro line-wrapped badly, so try this version, below.
HTH,
Bernie
MS Excel MVP
Sub Consolidate()
Dim myCell As Range
With Application
.DisplayAlerts = False
.EnableEvents = False
.ScreenUpdating = False
End With
With Application.FileSearch
.NewSearch
'Copy or move this workbook to the folder with
'the files that you want to summarize
.LookIn = ThisWorkbook.Path
.FileType = msoFileTypeExcelWorkbooks
If .Execute() 0 Then
Set Basebook = ThisWorkbook
For i = 1 To .FoundFiles.Count
If .FoundFiles(i) < ThisWorkbook.FullName Then
Set myBook = Workbooks.Open(.FoundFiles(i))
myBook.Worksheets("Daily!").Select
For Each myCell In _
Range("10:10").SpecialCells(xlCellTypeConstants)
If myCell.Value < "DOG" Then
ThisWorkbook.Worksheets(1). _
Range("A65536").End(xlUp)(2).Value = _
myCell.Offset(-3, 0).Value
End If
Next myCell
myBook.Close
End If
Next i
End If
End With
With Application
.DisplayAlerts = True
.EnableEvents = True
.ScreenUpdating = True
End With
Basebook.SaveAs Application.GetSaveAsFilename
End Sub
|