+ Reply to Thread
Results 1 to 2 of 2

type matching

  1. #1
    Registered User
    Join Date
    08-15-2006
    Posts
    22

    type matching

    I am running a macro where I call solver/goal seek. Sometimes, they go wonky and for whatever reason I get #NUM cells or something of the kind.

    Anyway, I also do some convergence checking after the fact (maybe there is an option with solver/goal seek calls to make this easier???) to try to at least count the cells that are not converged. I'd like to identify them at some point..(hint, hint)



    My real question is this:

    Is there a way that I can check for type matching before I try to compare a cell that SHOULD be numerical to a number, in case it has gone wonky?

    If type.CELLS(23,45) = number

    do something

    Else If

    do something else

    End If


    ....something like that?

  2. #2
    Valued Forum Contributor
    Join Date
    12-16-2004
    Location
    Canada, Quebec
    Posts
    363
    Hi

    I do know much about goal seek but to determine if a value is numeric this would help

    Sub check_valu()
    Dim Cell As Range
    Dim R As Range
    Set R = ActiveSheet.UsedRange
    For Each Cell In R
    If IsNumeric(Cell.Value) Then
    'do your normal process
    Else
    val_cell = Cell.Value
    adr_cell = Cell.Address(rowabsolute, columnabsolute)
    MsgBox val_cell Is Not numeric '& " " & adr_cell
    End If

    Next
    End Sub

+ 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