I'm trying the code below as recorded to find and replace. It works when I record it, but then I go back to original unedited file and try to run this macro where the headers are back to original - I get an error message? What's the best find and replace. I just want to replace a few header names and they might not always be under the same column. The error message is object variance or block variance not set?
Rows("1:1").Select
Selection.Find(What:="OLH: Task 1 Due Date", After:=ActiveCell, LookIn:= _
xlFormulas2, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Replace What:="OLH: Task 1 Due Date", Replacement:= _
"DDQ Order Due Date", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase _
:=False, SearchFormat:=False, ReplaceFormat:=False, FormulaVersion:= _
xlReplaceFormula2
Selection.FindNext(After:=ActiveCell).Activate
Rows("1:1").Select
Selection.Find(What:="OLH: Task 1 Due Date", After:=ActiveCell, LookIn:= _
xlFormulas2, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Replace What:="OLH: Task 1 Due Date", Replacement:= _
"DDQ Order Due Date", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase _
:=False, SearchFormat:=False, ReplaceFormat:=False, FormulaVersion:= _
xlReplaceFormula2
Selection.FindNext(After:=ActiveCell).Activate