I have a workbook with several sheets and want to find "DEPR-GENERATORS" in Col B and insert "DEPR in front on the text from one row below to 5 rows below
I have tried to write code -see below, but cannot get it to work. After running the code, the text below "DEPR-GENERATORS" must look like the text in Col C (C10:C14 -I have manually typed this in)
https://www.dropbox.com/s/ekbr242gcr7gdy6/Find Depr.xlsm
It would be appreciated if you could assist me in resolving this
I have tried to write code -see below, but cannot get it to work. After running the code, the text below "DEPR-GENERATORS" must look like the text in Col C (C10:C14 -I have manually typed this in)
Code:
Sub find_Depreciation()
Dim Sh As Worksheet
Dim lr As Long
For Each Sh In ActiveWorkbook.Worksheets
Select Case Sh.Name
Case "Data", "Man Accounts Bank", "Profit Check"
Case Else
With Sh
lr = .Cells(.Rows.Count, "B").End(xlUp).Row
Cells.Find(What:="DEPR-GENERATORS", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
.Range("B1:B" & lr).Resize(5).Replace What:=" ", Replacement:="DEPR", LookAt:=xlPart
End With
End Select
Next Sh
End Sub
https://www.dropbox.com/s/ekbr242gcr7gdy6/Find Depr.xlsm
It would be appreciated if you could assist me in resolving this