+ Reply to Thread
Results 1 to 9 of 9

Can I Find and Relace only a selection?

  1. #1
    Registered User
    Join Date
    11-13-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    6

    Can I Find and Relace only a selection?

    I had a problem previous to this that I posted. It had to do with the fact that Excel leaves some kind of fingerprint in a cell when you paste values from a blank cell or paste "". Whatever it leaves, the cell is not blank and sorts with a higher value than all letters of the alphabet. After frying a number of brain cells, I discovered that I could actually paste some unique value and then search and replace with nothing. This does in effect render the cell "empty" or "clear". This allows my sort to work as I want, which is to have the blank cells sort with a lower sort value either ascending or descending. This all needs to be done from within a macro which is the reason for appearing here. Now for my question.

    I am using version 2007. Is it no longer possible to find and replace only selected cells? This seems to have disappeared from Excel. The only options are Sheet or Workbook. My sheet is very large and Excel takes a long time searching the entire sheet for my unique string after it first quickly replaces within my selected cells.

    Thanx for any help.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Can I Find and Relace only a selection?

    You can do it for sure with a macro

    Please Login or Register  to view this content.
    Last edited by patel45; 11-17-2013 at 01:34 PM.
    If solved remember to mark Thread as solved

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Can I Find and Relace only a selection?

    Hi and welcome to the forum

    Before "using" F&R, highlight the range you want, then use F&R
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    11-13-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Can I Find and Relace only a selection?

    This is what I get when I try to run that code in Excel 2007.

    Run-time error 438

    Object doesn't support this property or method

  5. #5
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Can I Find and Relace only a selection?

    I'm sorry, change to

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-13-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Can I Find and Relace only a selection?

    Excel 2007 (or at least my version) does not recognize the above code as a valid macro. It is listed in the macros, but when I select it, everything is greyed out except "Create".

  7. #7
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Can I Find and Relace only a selection?

    did you put the code in modules ?

  8. #8
    Registered User
    Join Date
    11-13-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Can I Find and Relace only a selection?

    Yes. It follows and is listed with the other macros.

    If you have a version of excel that allows find & replace of just the selection, could you tell me what options are listed under "Within" when you expand the "Replace Options"? Is the code you have supplied a result of automatically recording the movements of your mouse and keyboard while performing a Find and Replace operation? Could you go ahead and record those movements, including the selection of a group of cells, so that I might see what excel writes for itself?

    Thanx for your help.

  9. #9
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Can I Find and Relace only a selection?

    I did not use macro recorder, try creating a new module or changing the sub name

+ 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] How to code the selection.find not to crash when the data to find is blank
    By evertjvr in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-25-2012, 03:04 PM
  2. Selection.Find Fix
    By CrazyFileMaker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-18-2009, 09:39 PM
  3. how do I relace words in new ones in certain cells in Excel
    By Anita in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-05-2006, 11:11 PM
  4. selection.find help!
    By Duncan in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-18-2006, 05:10 AM
  5. how do I relace the fx with a = in Excel?
    By widget in forum Excel General
    Replies: 2
    Last Post: 06-10-2005, 04:05 PM

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