VBA Quick Question

  • Thread starter Thread starter Gerard Sanchez
  • Start date Start date
G

Gerard Sanchez

Hi,

I was wondering instead of

If Range("F65") > 0 Then Range so and so .printount

I was wondering if there's any way I can get this line to apply strictly to
numeric results, because currently code sees the text results also as
greater than zero ( >0 ) ??
 
Dear Gerard

You can try this. Post back incase of any queries..

If Cint("0" & Range("F65")) > 0

If this post helps click Yes
 
This is the code I am working with

If Range ("F65") > 0 And _
Range("G59") <> "SELECT CUSTOMER" And _
Range("F64") <> "SELECT USER" And _
WorksheetFunction.CountA(Range("C61"), _
Range("C62"), Range("F61"), Range("F62"), _
Range("I61"), Range("I62")) = 1 Then

Range("A18:I69").PrintOut Copies:=1

Else

The Problem is that when F65 = "NOT BALANCED !" I don't want it to print.
Currently it does.

When I replaced first line to this

If CInt("0" & Range("F65")) > 0 And _
Range("G59") <> "SELECT CUSTOMER" And _
Range("F64") <> "SELECT USER" And _
WorksheetFunction.CountA(Range("C61"), _
Range("C62"), Range("F61"), Range("F62"), _
Range("I61"), Range("I62")) = 1 Then

Range("A18:I69").PrintOut Copies:=1

I got a Type Mismatched Error. The whole code is highlighted
 
Sorry Gerard. I didnt notice the text part..As the other post says you will
need to use IsNumeric function....Cheers
 
That's okay.

Cheers!


Jacob Skaria said:
Sorry Gerard. I didnt notice the text part..As the other post says you
will
need to use IsNumeric function....Cheers
 
Back
Top