Thread: Audit Programme
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Audit Programme

Dim FName As String
Dim FoundCell As Range
Dim WB As Workbook
Dim sh as Worksheet
ChDrive "C:"
ChDir "C:\Wtt"
FName = Dir("*.xls")
Do Until FName = ""
Set WB = Workbooks.Open(FName)
for each sh in WB.Worksheets
Set FoundCell = Sh.Columns(1).Find( _
what:="2222")
if not FoundCell is Nothing then
Application.Goto Reference:=FoundCell, Scroll:=True
msgbox "Take a look"
End if

wb.close Savechanges:=False
fName = Dir()
Loop

if there will be multiple 2222 on a single sheet, post back.

--
Regards,
Tom Ogilvy


"Steved" wrote in message
...
Hello From Steved

I've been trying to get the below program to work.

My object is to Audit my worksheets as for example
I Type in 2222 it will then goto the cell with the value
2222 in it. I want it to stop to allow me to check and
then continue until all is found please. It only needs to
look in Column A of Each worksheet. Below is as far as I
have got.

Dim FName As String
Dim FoundCell As Range
Dim WB As Workbook
ChDrive "C:"
ChDir "C:\Wtt"
FName = Dir("*.xls")
Do Until FName = ""
Set WB = Workbooks.Open(FName)
Set FoundCell = WB.Worksheets(1).Cells.Find(what:="the
value is 2222")

Thankyou.