+ Reply to Thread
Results 1 to 4 of 4

Test Cells if they are numeric

  1. #1
    Registered User
    Join Date
    04-28-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    28

    Test Cells if they are numeric

    Hi,

    I'm trying to write a macro that will go down a column checking to check each cell and if it is a number do a calculation based on the value in that cell

    I have to search the column to know where to start and finish the search as this cannot be done on the whole column.

    I'm new to this can you help

    Thanks

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Test Cells if they are numeric

    Quote Originally Posted by GBR2L View Post
    I have to search the column to know where to start and finish the search as this cannot be done on the whole column.
    Please clarify this bit.
    The basic test you want is the IsNumeric function.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    04-28-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Test Cells if they are numeric

    I need to loop through a series of cells, I understand the isnumeric function but I cannot seem to get it to work for each cell going down the column.

    The code I have so far does not work and I cannot find the correct syntax.

    The code I currently have is where "i" is a row number

    if IsNumeric(.Cells([i], [3])) = True Then

    If you can help that would be great

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Test Cells if they are numeric

    You don't need square brackets there:
    Please Login or Register  to view this content.
    (please use code tags around your code, even if you are only posting one line!)

+ 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