Consulting

Results 1 to 2 of 2

Thread: Solved: How to test formulas results?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Mar 2013
    Posts
    80
    Location

    Unhappy Solved: How to test formulas results?

    Hello. My question is probably very basic: I am learning bymyself VBA and I am having trouble to work with the results of a formula.

    example I've already used...
    If WorksheetFunction.IsNA(Cells(Go, 20)) Then...

    How to test the same way if a cell is blank or for example =6?

    In this examples,
    cells(Go,20) is either blank or contains a formula returning a text.
    cells(Go,21) is either blank or contains a formula returning a value

    To make it work, I had to first copy/paste as value the result of the formula calculation, but I am sure I could skip this step.

    Thanks!

    [VBA]While Go < Lignes
    Go = Go + 1
    If Cells(Go, 20) <> "" Then
    If Cells(Go, 21) > 0 Then
    ....
    Else
    ....
    End If
    ElseIf Cells(Go, 21) = Cells(Go,3) Then
    ....
    Else
    End If
    Wend[/VBA]
    Last edited by Aussiebear; 03-26-2013 at 03:58 AM. Reason: added the correct tags to the supplied code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •