John Davis
Well-known Member
- Joined
- Sep 11, 2007
- Messages
- 3,457
Hello All:
I have the following code:
What I need is the actions in the procedure to run on each of the workbooks and then close with the changes. My mind is blank at the moment, any help or advice on how too achieve this would be appreciated.
I have the following code:
Code:
Sub ReplaceZeros()
Dim i As Long
Dim lr As Long
ChDir "I:\nafta\RFP\DataK\CM\Traffic\Excel"
Workbooks.Open Filename:="I:\nafta\RFP\DataK\CM\Traffic\Excel\AGFA_HC.xls"
Workbooks.Open Filename:="I:\nafta\RFP\DataK\CM\Traffic\Excel\AgfaParts1.xls"
Workbooks.Open Filename:="I:\nafta\RFP\DataK\CM\Traffic\Excel\AgfaParts2.xls"
lr = Cells(Rows.Count, 1).End(3).Row
For i = lr To 2 Step -1
If Len(Range("A" & i)) = 8 Then
Range("A" & i).Replace What:="000", Replacement:="", LookAt:=xlPart
End If
Next i
End Sub
What I need is the actions in the procedure to run on each of the workbooks and then close with the changes. My mind is blank at the moment, any help or advice on how too achieve this would be appreciated.