+ Reply to Thread
Results 1 to 8 of 8

How can I let the macro determine if the contents of a cell is numeric or text

  1. #1
    Registered User
    Join Date
    05-19-2012
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    11

    How can I let the macro determine if the contents of a cell is numeric or text

    Hello everyone,

    i need a help on this one.... I encoded a macro that will simply get the difference of the two column with the use of "DO" and "LOOP" function. But if the cell contains a text data it generates an error and stops the macro. here is my macro:

    Please Login or Register  to view this content.
    How should it appear if i want that the formula will continue until cell.offset(0,-1).value = "" even if along the way there is an error (in this case there is a text data in the cell)?

    Thanks!

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: How can I let the macro determine if the contents of a cell is numeric or text

    try it
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-19-2012
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: How can I let the macro determine if the contents of a cell is numeric or text

    this works perfectly great!!!! thanks!!!

  4. #4
    Registered User
    Join Date
    05-19-2012
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: How can I let the macro determine if the contents of a cell is numeric or text

    but why if i run this macro using Office 2003 the result is "#NAME?"? do we have any work around for this?

  5. #5
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: How can I let the macro determine if the contents of a cell is numeric or text

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    05-19-2012
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: How can I let the macro determine if the contents of a cell is numeric or text

    Thanks man! you're the best.. where can i find the explanation for this formula? i want to understand the logic behind this statement... thanks!

  7. #7
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: How can I let the macro determine if the contents of a cell is numeric or text

    Just remove this line
    Please Login or Register  to view this content.
    and you can see very simple formulas in a worksheet

  8. #8
    Registered User
    Join Date
    05-19-2012
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: How can I let the macro determine if the contents of a cell is numeric or text

    now i get it... thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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