Hello to all.
I would like to ask you if you find someone who can help me with these two macros that work very well but for certain things. So because I do not understand many will not explain what the problem is:
The first is made so that the popup window to search for a word in countless workbooks, it does but only in the open sheet of the workbook. So you can be less that the revised starting from the first workbook, going through all the Sheets then goes to the second sheet and check all the way to the end?
Sub SearchBookss()
SearchWord = InputBox("Enter the string to search for")
For i = 1 To Workbooks.Count
Workbooks(i).Activate
Range("A1").Activate
FindAnother:
Set WordAddress = Cells.Find(What:=SearchWord, after:=ActiveCell, LookIn:=xlFormulas, lookat:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
If WordAddress Is Nothing Then
MsgBox ActiveWorkbook.Name & Chr(13) & "Search string not found"
Else:
If WordAddress.Address = CheckCell Then GoTo NextBook
If ActiveCell.Address = "$A$1" Then CheckCell = WordAddress.Address
Address = WordAddress.Address
MsgBox ActiveWorkbook.Name & Chr(13) & Address
Range(Address).Activate
GoTo FindAnother
End If
NextBook:
Next i
End Sub
My second problem:
This macro also works perfectly: I open a new workbook (book1), I put my macro button to call after his appearance, immediately began to seek how many workbooks are in a folder where it is located (book1). For example, in a folder Trii / 10 I excel file that shows them to me in column A: A (book1), then in the box izkochiliyat I wanted to write about what I want to look and how to replace it - this is the same as standard option in excel (Find and Replace) but looking in all workbooks and the problem here is that the macro is designed to look at specific cells and truly replaces words.
So the problem is whether you less to fix it to look absolutely all cells in all worksheets.
I believe that is a matter of minor fixes somewhere in the code, but because they do not understand, I do not know where to Complete the thing.
Sub general()
Dim z  As Long, e As Long, g As Long
Dim f As String, m As String, n As String
Sheets("Sheet1").Select
Cells(1, 1) = "=cell(""filename"")"
Cells(1, 2) = "=left(A1,find(""["",A1)-1)"
Cells(2, 1).Select
f = Dir(Cells(1, 2) & "*.xls")
    Do While Len(f) > 0
    ActiveCell.Formula = f
    ActiveCell.Offset(1, 0).Select
    f = Dir()
    Loop
m = InputBox("Enter search string")
n = InputBox("Enter replacement string") 'common replacement
z = Cells(Rows.Count, 1).End(xlUp).Row
    For e = 2 To z
        If Cells(e, 1) <> ActiveWorkbook.Name Then
        Workbooks.Open Filename:=Cells(1, 2) & Cells(e, 1)
            For a = 1 To Sheets.Count
           'n = InputBox("Enter replacement string for sheet -  " & Worksheets(a).Name) ' sheetwise replacement
            x = Worksheets(a).Cells(Rows.Count, 3).End(xlUp).Row
                For b = 2 To x
                    If InStr(Worksheets(a).Cells(b, 3), m) > 0 Then
                    Worksheets(a).Cells(b, 11) = n
                    End If
                Next b
            Next a
        ActiveWorkbook.Close True
        End If
    Next e
MsgBox "collating is complete."
End Sub