+ Reply to Thread
Results 1 to 4 of 4

An interesting challenge! (Find & fix 'Numbers stored as text'

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Talking An interesting challenge! (Find & fix 'Numbers stored as text'

    I had a friend come to me recently with a problem he wanted fixed. He has a sheet in a workbook which contains a number of cells throughout the page with the 'Number stored as Text' error. As there is so many of them, he doesn't look forward to fixing all these manually cell by cell.

    What I am looking for is code that can:
    1. Find all cells in active sheet (or maybe usedrange?) that are 'Numbers stored as text'
    2. Convert the values of these cells to number format

    I thought this would be easy to write but it's not.

    While tempting to fix the entire sheet values, it is important to actually locate the cells with this error as the sheet contains cells with other formats etc. that must not be altered.
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

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

    Re: An interesting challenge! (Find & fix 'Numbers stored as text'

    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.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: An interesting challenge! (Find & fix 'Numbers stored as text'

    Another method...

    Please Login or Register  to view this content.

  4. #4
    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
    53,048

    Re: An interesting challenge! (Find & fix 'Numbers stored as text'

    I know this works on a single column or row, but have not tried it on an array range, give a try, it wont hurt anything...

    find the top-leftest (is that a real word lol?) cell with the text in it. then highlight the entire range, down and across. use the mouse and scroll bars to scroll back to the top-left highlighted cell. you will see a little yellow "warning" diamond. click on that and you will see the option to "convert to number"

    Hope it works

    edit: just reied it on an array (rows and columns), and it worked great
    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

+ 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