+ Reply to Thread
Results 1 to 9 of 9

Find and replace contents

  1. #1
    Registered User
    Join Date
    01-12-2010
    Location
    Salt Lake City
    MS-Off Ver
    Excel 2007
    Posts
    29

    Find and replace contents

    I would like to find a way to search a worksheet for cells with numbers, positive or negative, and then replace with "0". I want those cells with formulas or text to remain the same.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Find and replace contents

    Ctrl+G ("go to") > Special > Constants, tick Numbers, press OK.

    Put 0 in the formula bar, press and hold the Ctrl key, press Enter.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Find and replace contents

    Your very brief explanation suggests to me that this is not possible without VBA. However...

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  4. #4
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Find and replace contents

    try this macro
    Please Login or Register  to view this content.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Find and replace contents

    If you do need a macro, maybe try...

    Please Login or Register  to view this content.
    HTH
    Regards, Jeff

  6. #6
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Find and replace contents

    @Jeff what is the difference between Constant and the return of the function IsNumeric?
    Your macro has a different outcome then mine. Yours is pretty cool.

  7. #7
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Find and replace contents

    Quote Originally Posted by p24leclerc View Post
    @Jeff what is the difference between Constant and the return of the function IsNumeric?
    I'm not aware of any difference between using the IsNumeric versus searching for Constants.

    However, here are a few difference I see...

    1) Looping thru all of the cells could be slower; whereas, the SpecialCells(xlCellTypeConstants, 1) does the update all in one pass

    2) Using Range("A1").CurrentRegion -- This could cause problems, if for instance, columns B & C were empty and the next set of data starts in column D. For CurrentRegion to work, the set of data has to be contiguous

    3) Maybe instead of Range("A1").CurrentRegion you could use ActiveSheet.UsedRange

    Anyway, just a few thoughts. Hope it helps.

  8. #8
    Registered User
    Join Date
    01-12-2010
    Location
    Salt Lake City
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Find and replace contents

    Jeff, you post worked great, just what I was looking for.

  9. #9
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Find and replace contents

    Glad it worked out for you.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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] 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
  2. Find and Replace the contents of one cell with the contents of another
    By thechevs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-30-2014, 06:48 AM
  3. [SOLVED] VBA Find and Replace Using Cell Contents
    By DMumme in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-10-2014, 10:22 AM
  4. Replies: 2
    Last Post: 06-12-2013, 03:48 PM
  5. Find and replace a character with another cell contents
    By tcapewell in forum Excel General
    Replies: 4
    Last Post: 07-12-2010, 10:23 AM
  6. Find and replace with contents of a cell
    By gettingthere in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-27-2009, 03:24 PM
  7. [SOLVED] Find and Replace Hyperlink Contents
    By Dede in forum Excel General
    Replies: 11
    Last Post: 04-28-2005, 08:06 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