Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default VBA Quick Question

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 ) ??


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default VBA Quick Question

Dear Gerard

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

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

If this post helps click Yes
---------------
Jacob Skaria
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default VBA Quick Question

Hi Jpcob,

I got a syntax error??


"Jacob Skaria" wrote in message
...
Dear Gerard

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

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

If this post helps click Yes
---------------
Jacob Skaria



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default VBA Quick Question

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


"Jacob Skaria" wrote in message
...
Dear Gerard

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

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

If this post helps click Yes
---------------
Jacob Skaria



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default VBA Quick Question

Sorry Gerard. I didnt notice the text part..As the other post says you will
need to use IsNumeric function....Cheers

"Gerard Sanchez" wrote:

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


"Jacob Skaria" wrote in message
...
Dear Gerard

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

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

If this post helps click Yes
---------------
Jacob Skaria






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default VBA Quick Question


That's okay.

Cheers!


"Jacob Skaria" wrote in message
...
Sorry Gerard. I didnt notice the text part..As the other post says you
will
need to use IsNumeric function....Cheers

"Gerard Sanchez" wrote:

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


"Jacob Skaria" wrote in message
...
Dear Gerard

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

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

If this post helps click Yes
---------------
Jacob Skaria






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default VBA Quick Question


If Isnumeric(Range("F65"))=true and Range("F65") 0 then blablablablalba

"Gerard Sanchez" wrote:

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 ) ??



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default VBA Quick Question

This did the trick!

Thanks :)


"filo666" wrote in message
...

If Isnumeric(Range("F65"))=true and Range("F65") 0 then blablablablalba

"Gerard Sanchez" wrote:

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 ) ??





  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default VBA Quick Question

Gerard

Before using isnumeric see this thread.

You could be surprised.

http://tinyurl.com/9to4ka


Gord Dibben MS Excel MVP

On Mon, 16 Mar 2009 00:07:09 -0700, "Gerard Sanchez"
wrote:

This did the trick!

Thanks :)


"filo666" wrote in message
...

If Isnumeric(Range("F65"))=true and Range("F65") 0 then blablablablalba

"Gerard Sanchez" wrote:

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 ) ??





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
quick question riggi Excel Discussion (Misc queries) 4 January 31st 07 06:11 AM
quick question Gary Keramidas Excel Programming 6 December 14th 06 05:38 PM
Quick Question Nikki Excel Worksheet Functions 4 January 31st 06 02:51 PM
Quick question - quick answer about assigning shortcut keys funkymonkUK[_75_] Excel Programming 1 October 13th 05 10:50 AM
Very Quick Question Chuckles123[_69_] Excel Programming 1 November 18th 04 05:49 PM


All times are GMT +1. The time now is 03:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"