PDA

View Full Version : Replacing link to another Worksheet by possibly inexistant sheet name



N35t0r
09-12-2008, 11:41 AM
Hello all,


I've got a macro that, among other things, uses a replace command to change a link to a worksheet on another file to another sheet which may or may not exist (called the same as the current sheet)

Cells.Replace What:="MIGRADO DE SOFT", Replacement:=sheetname, LookAt:=xlPart

My problem is that if the sheet does not exist, I get a message upon doing that and get to chose between the existing sheets in that book (to which chose cancel) and the replace stops. Is there any way to avoid this? I've got Application.DisplayAlerts = False

but I still get that dialogue box.

Should I use function replace instead?


Thanks in advance,

Nestor