Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I am trying to find a specific text in a worksheet and then put a certaint text in cells next to where first text is found. And I want to do it in all worksheets in the file I have. Here is the code that I came up with but this only works on the active worksheet that I am in... I think it should work on all worksheets in the file. Does anyone know why it would do that... Sub macro2 Dim wks As Worksheet Dim txtlookup As String Dim txtchange As String txtlookup = InputBox("Enter Text to Lookup:", "Enter Text") txtchange = InputBox("Enter Text to change to:", "Enter Text") For Each wks In ThisWorkbook.Sheets For Each cell In Range("A1:A2000") If cell.Value = txtlookup Then cell.Offset(0, 1).Value = txtchange End If Next cell Next wks End Sub Thanks, Jay -- sa02000 ------------------------------------------------------------------------ sa02000's Profile: http://www.excelforum.com/member.php...o&userid=27747 View this thread: http://www.excelforum.com/showthread...hreadid=568789 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
find replace in multiple sheets based on namebox | Excel Discussion (Misc queries) | |||
Replace with Grouped Sheets | Excel Discussion (Misc queries) | |||
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA | Excel Worksheet Functions | |||
how do I do a global replace in all sheets in a workbook? | Excel Worksheet Functions | |||
Find / Replace sheets vs workbook in VB | Excel Worksheet Functions |