ValerieT
03-26-2013, 01:51 AM
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!
While Go < Lignes
Go = Go + 1
If Cells(Go, 20) <> "" Then :dunno
If Cells(Go, 21) > 0 Then :banghead:
....
Else
....
End If
ElseIf Cells(Go, 21) = Cells(Go,3) Then :motz2:
....
Else
End If
Wend
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!
While Go < Lignes
Go = Go + 1
If Cells(Go, 20) <> "" Then :dunno
If Cells(Go, 21) > 0 Then :banghead:
....
Else
....
End If
ElseIf Cells(Go, 21) = Cells(Go,3) Then :motz2:
....
Else
End If
Wend