Results 1 to 3 of 3
  1. #1
    mkc80 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    56

    Scan a Column in EXCEL for a text and replace it with a different text/number

    Hello,

    I am trying to search a column say M (From M2:M2999) in an excel file and see if I have division by zero errors (#DIV/0!) , and I would like to replace the text with text string '0'.


    Can someone please show me the IIF code for it? Or some other way to replace the text programmatic'ally in VBA.

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Google: Excel VBA find replace

    Lots of hits, start with http://dmcritchie.mvps.org/excel/replace.htm
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    The VBA Man is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    7

    Replacing Error Cells with "0"

    try this from a Sub in a module, or just paste in the Immediate Window...

    Range("M2:M2999").SpecialCells(xlCellTypeFormulas, 16).FormulaLocal = "0"

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 05-29-2012, 04:47 PM
  2. Replies: 1
    Last Post: 05-24-2012, 04:59 AM
  3. End of Text Box - Replace Comma with Period
    By bburton in forum Programming
    Replies: 14
    Last Post: 06-20-2011, 03:20 PM
  4. Replace a string/text in ms-access db
    By anziga in forum Queries
    Replies: 4
    Last Post: 12-31-2010, 06:40 PM
  5. pulling text values into FK number column
    By REBBROWN in forum Database Design
    Replies: 2
    Last Post: 08-30-2010, 05:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums