Range Replace

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The following macro works well as two seperate halves but fails when joined
together
Range(ActiveCell, ActiveCell.Offset(2, 0)).Select
Selection.EntireRow.Select.Replace What:=Range("AB28"), _
Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False

The first half works, but the second half (from "Replace...") comes back
with the comment "Run Time Error 424" & " Object required", can anyone please
help?

Rewop Eilsel
 
Try something more like this...

Range(ActiveCell, ActiveCell.Offset(2, 0)).EntireRow.Replace _
What:=Range("AB28"), _
Replacement:="", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top