Hello bois,
I need your help once more. I'm putting together a Macro to find a certain string, then add the string's row and the one above it together. This string is on many rows, but not on different columns.
All I have is this, finds the string then grabs the cells needed to add them together, but I need the whole row. Columns are from Column C to Column CO. Any ideas on how to get this to work?
I need your help once more. I'm putting together a Macro to find a certain string, then add the string's row and the one above it together. This string is on many rows, but not on different columns.
All I have is this, finds the string then grabs the cells needed to add them together, but I need the whole row. Columns are from Column C to Column CO. Any ideas on how to get this to work?
Code:
Sub E()
Dim Pub As Range, Col As Range, Ad As Range
Dim Sh As Worksheet
For Each Sh In ThisWorkbook.Worksheets
With Sh.UsedRange
Set Pub = .Cells.Find(What:="Printing and Publications")
If Not Pub Is Nothing Then
Do Until Pub Is Nothing
Set Ad = Pub.Offset(-1, 1)
Set Col = Pub.Offset(0, 1)
'Pub.Offset(1).EntireRow.Insert shift:=xlDown /inserts a new row
Pub.Value = Ad + Col
Set Pub = .FindNext(Pub)
Loop
End If
End With
Set Pub = Nothing
Next
End Sub