Runtime Error 1004

D

Don

Further, if I remove the dot before the
Range("L2").Select
It works, but not necessaarily on the right sheet.
 
T

Tom Ogilvy

Why do you need to select L2 or L4 by themselves.

With Worksheets(MySheet)
.Cells.Select
.Paste
Application.CutCopyMode = False
.Range("J2,L2,L4").Replace _
What:="Sheet1", _
Replacement:=LinkTo, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
.Move Before:=Sheets(1)
End With

Should still work the way you want it to.
 
D

Don

Thanks Tom

The only reason I do any of this is beacause of a bug that
prevents me from Copying more than 3 sheets in a Session,
but the issue is not the Replace, it's the fact that
things don't work even though I have UserModeOnly enabled.

I even have a routine that invokes UserModeOnly in every
Sub as a workaround to another bug.

Don.
 

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

Top