Consulting

Results 1 to 5 of 5

Thread: Vba Replace Function

  1. #1
    VBAX Regular
    Joined
    Sep 2007
    Posts
    20
    Location

    Vba Replace Function

    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.-

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    This works for me

    [Code]
    Selection.Replace What:="#REF!", Replacement:="a25", LookAt:=xlPart
    [/vCode]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Sep 2007
    Posts
    20
    Location
    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.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Your What value was in error.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Regular
    Joined
    Sep 2007
    Posts
    20
    Location
    Thanks a lot!!!

    Nothing like a trained eye...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •