PDA

View Full Version : [SOLVED:] Vba Replace Function



cactus
01-29-2010, 10:50 AM
Hello,

This code is not working for me and it doesn't give me errors:


Selection.Replace What:="#¡REF!", Replacement:="a25", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, _
SearchFormat:=False, ReplaceFormat:=False


In the selected range i have GetPivotData formulas wrong referenced.
If I perform the Find & Replace in excel it works fine.

Any Ideas? Maybe an alternative solution

Thanks in advance,

cactus.-

Bob Phillips
01-29-2010, 02:32 PM
This works for me

[Code]
Selection.Replace What:="#REF!", Replacement:="a25", LookAt:=xlPart
[/vCode]

cactus
02-01-2010, 05:49 AM
Thanks XLd, it works now.

Just in order to learn; what was I doing wrong?

When i record a macro, the code includes the arguments that i've posted.

Thanks again.

Bob Phillips
02-01-2010, 07:00 AM
Your What value was in error.

cactus
02-01-2010, 07:43 AM
Thanks a lot!!!

Nothing like a trained eye...