Dim users, Usersheet, date1 As String
Sheets("Sheet3").Select
Range("A1").Select
date1 = InputBox("Enter a date")
For i = 1 To 231
While Len(ActiveCell.Value) 0
users = ActiveCell.Value
If Dir("P:\clevedon staff\activities\" & users & "\" & users & date1 &
".xls") < "" Then
'users = ActiveCell.Value
'Do the stuff here
MsgBox ("File Exists")
Workbooks.Open FileName:= _
"\\FP06\apps\Clevedon Staff\Activities\" & users & "\" & users &
date1 & ".xls"
Range("B2:G25").Select 'error occurs here
Selection.Copy
ActiveWindow.ActivateNext
Range("B2:G25").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False
Usersheet = ActiveCell.Value
Sheets(Usersheet).Close
Sheets("sheet3").Select
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select
End If
Wend
Next i
End Sub
--
Joseph
------------------------------------------------------------------------
Joseph's Profile:
http://www.excelforum.com/member.php...fo&userid=5637
View this thread:
http://www.excelforum.com/showthread...hreadid=264190