+ Reply to Thread
Results 1 to 14 of 14

Find & Replace All Sheets Using VBA

  1. #1
    Registered User
    Join Date
    05-26-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    7

    Find & Replace All Sheets Using VBA

    Thanks in advance!

    I need to find column a and replace with column B text across all sheets. The code I have is only doing the find and replace on one sheet? Any tips?

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    05-26-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Find & Replace All Sheets Using VBA

    Correction on Code..

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    03-21-2012
    Location
    Ho Chi Minh city
    MS-Off Ver
    Excel 2003
    Posts
    180

    Re: Find & Replace All Sheets Using VBA

    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    818

    Re: Find & Replace All Sheets Using VBA

    Please Login or Register  to view this content.
    Last edited by HSV; 05-28-2012 at 05:45 AM. Reason: Edit the wrong code
    Kind regards, Harry.

  5. #5
    Registered User
    Join Date
    05-26-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Find & Replace All Sheets Using VBA

    Thanks! That worked faster. However it is only finding and replacing in row A and row B across all sheets... I want it search entire worksheet for text shown in "row A" and replace any instance of it with the corresponding text in "row B" . I do not want it to match entire cell content.

    Is that possible?

  6. #6
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    818

    Re: Find & Replace All Sheets Using VBA

    Please Login or Register  to view this content.
    Last edited by HSV; 05-28-2012 at 05:42 AM.

  7. #7
    Registered User
    Join Date
    05-26-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Find & Replace All Sheets Using VBA

    getting error.. Capture.PNG

  8. #8
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    818

    Re: Find & Replace All Sheets Using VBA

    I have a file imitated, but no error to me.
    Maybe you could upload your file so we can see where things go wrong.

  9. #9
    Registered User
    Join Date
    05-26-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Find & Replace All Sheets Using VBA

    Quote Originally Posted by HSV View Post
    I have a file imitated, but no error to me.
    Maybe you could upload your file so we can see where things go wrong.
    Here ya go! And thanks again.

  10. #10
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    818

    Re: Find & Replace All Sheets Using VBA

    Your length of your words may have a length to 255 characters.
    Sheet 1 cell B6 has 461 characters.

  11. #11
    Registered User
    Join Date
    05-26-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Find & Replace All Sheets Using VBA

    Quote Originally Posted by HSV View Post
    Your length of your words may have a length to 255 characters.
    Sheet 1 cell B6 has 461 characters.
    Shortened it and it still is only replacing rows A & B only, its not finding instances of A in entire sheet and replacing all instances of A with B... lol. I've been trying to get this to work for 2 days.

  12. #12
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    818

    Re: Find & Replace All Sheets Using VBA

    Replace by 'xlwhole' 'xlpart'

  13. #13
    Registered User
    Join Date
    05-26-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Find & Replace All Sheets Using VBA

    Quote Originally Posted by HSV View Post
    Replace by 'xlwhole' 'xlpart'
    THANK YOU!!!!!!!!!!!!

    I could give you hug!

    -Tierra

  14. #14
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    818

    Re: Find & Replace All Sheets Using VBA

    You’re welcome,

    Make sure columns B not blank cells in it.
    Otherwise columns A will be a blank cell to.
    Change the code to overcome.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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