lior03
03-26-2006, 01:00 AM
hello
i have a workbbok with many sheets. each sheet contains the month name.each month i have to submit a report.
i am trying to replace at once all previous month with the new month name.i do not want to repeat the action on each sheet.
Dim X, Y
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
Y = InputBox("what to replace")
If Y = vbCancel Then Exit Sub
X = InputBox("with what")
If Y = vbCancel Then Exit Sub
Cells.Replace What:=Y, _
Replacement:=X, LookAt:=xlPart, MatchCase:=False
Next
Exit Sub
thanks
i have a workbbok with many sheets. each sheet contains the month name.each month i have to submit a report.
i am trying to replace at once all previous month with the new month name.i do not want to repeat the action on each sheet.
Dim X, Y
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
Y = InputBox("what to replace")
If Y = vbCancel Then Exit Sub
X = InputBox("with what")
If Y = vbCancel Then Exit Sub
Cells.Replace What:=Y, _
Replacement:=X, LookAt:=xlPart, MatchCase:=False
Next
Exit Sub
thanks