+ Reply to Thread
Results 1 to 6 of 6

Find and Replace

  1. #1
    Registered User
    Join Date
    10-07-2015
    Location
    Columbus, OH
    MS-Off Ver
    2007
    Posts
    35

    Find and Replace

    Everywhere I can find online seems to have the same syntax for this simple find and replace. But for some reason it doesn't work.
    Any ideas why?

    Worksheets("BPC Upload Sheet").Range("A1:AZ500").Replace What:= "L:\Budget Tool\P33\Working File\Control File\[BPC Upload File.xlsx]", Replacement:=""

  2. #2
    Registered User
    Join Date
    08-01-2012
    Location
    Montreal, Qc, Canada
    MS-Off Ver
    Excel 2010
    Posts
    82

    Re: Find and Replace

    found this that might help you ... http://www.techonthenet.com/excel/fo...eplace_vba.php


    copy and past from page

    -------------------------

    EXAMPLE (AS VBA FUNCTION)

    The REPLACE function can be used in VBA code in Microsoft Excel.

    Let's look at some Excel REPLACE function examples and explore how to use the REPLACE function in Excel VBA code:

    Please Login or Register  to view this content.
    If I helped, Don't forget to add to my reputation

  3. #3
    Registered User
    Join Date
    10-07-2015
    Location
    Columbus, OH
    MS-Off Ver
    2007
    Posts
    35

    Re: Find and Replace

    Thank you.
    I saw that as well but couldn't figure out how to use that method. Maybe if I put the whole string in there for both of the first 2. But I'm not sure about referencing the worksheet either.
    Maybe like this:
    Worksheets("BPC Upload Sheet").Replace("L:\Budget Tool\P33\Working File\Control File\[BPC Upload File.xlsx]", "L:\Budget Tool\P33\Working File\Control File\[BPC Upload File.xlsx]", "")

  4. #4
    Registered User
    Join Date
    10-07-2015
    Location
    Columbus, OH
    MS-Off Ver
    2007
    Posts
    35

    Re: Find and Replace

    Nope. There's a syntax error in there somewhere.

  5. #5
    Registered User
    Join Date
    12-03-2012
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2010, 2013, 2016
    Posts
    41

    Re: Find and Replace

    That's is the proper syntax... Are you getting an error? I just copied and pasted your code and it worked fine for me.

    Where did you post the code? In a code module or a worksheet module?

    Try adding this additional argument:

    Please Login or Register  to view this content.
    Using Excel 2010, 2013 & 2016 | Windows 7 | 64 Bit

  6. #6
    Registered User
    Join Date
    10-07-2015
    Location
    Columbus, OH
    MS-Off Ver
    2007
    Posts
    35

    Re: Find and Replace

    Well I have no idea what difference adding that would make but it works now. So strange.
    Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Using find replace to first find two double quotes and replace with a single double quote
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-17-2015, 10:13 AM
  2. [SOLVED] Find and replace where contents a formula so can't be seen by Find and replace.
    By markDuffy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-26-2015, 02:24 PM
  3. Replies: 16
    Last Post: 12-02-2014, 03:38 PM
  4. Replies: 3
    Last Post: 11-25-2014, 06:08 AM
  5. find in excel replace in word: find/replace text in text boxes and headers
    By dean.rogers in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-10-2012, 12:40 PM
  6. Multiple Find and Replace to replace a list of strings
    By WalterP34 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-11-2011, 07:41 PM
  7. find and replace - replace data in rows to separated by commas
    By msdker in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-14-2006, 08:10 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1