View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ctech[_36_] Ctech[_36_] is offline
external usenet poster
 
Posts: 1
Default For each workbook


I need two versions of my code below, which now replaces a text in all
sheets of an open workbook.

WHAT I NEED IN ADDITION TO THIS IS:

1. Replace in all open workbooks,
2. Replace in all workbooks in specified folder....



THIS IS MY CODE:

Private Sub cmd_OK_Click()
Dim Morg
Dim Mto

Morg = Lbud.TextBox_org
Mto = Lbud.TextBox_to



Dim Sht As Worksheet



For Each Sht In Worksheets
Sht.Cells.Replace What:=Morg, _
Replacement:=Mto, LookAt:=xlPart, MatchCase:=False
Next





Unload Lbud
End Sub


--
Ctech
------------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745
View this thread: http://www.excelforum.com/showthread...hreadid=481942