PC Review


Reply
Thread Tools Rate Thread

VBA Quick Question

 
 
Gerard Sanchez
Guest
Posts: n/a
 
      16th Mar 2009
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 With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      16th Mar 2009
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
 
Reply With Quote
 
 
 
 
filo666
Guest
Posts: n/a
 
      16th Mar 2009

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 With Quote
 
Gerard Sanchez
Guest
Posts: n/a
 
      16th Mar 2009
Hi Jpcob,

I got a syntax error??


"Jacob Skaria" <(E-Mail Removed)> wrote in message
news:629C9228-92D5-41F9-9950-(E-Mail Removed)...
> 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



 
Reply With Quote
 
Gerard Sanchez
Guest
Posts: n/a
 
      16th Mar 2009
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" <(E-Mail Removed)> wrote in message
news:629C9228-92D5-41F9-9950-(E-Mail Removed)...
> 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



 
Reply With Quote
 
Gerard Sanchez
Guest
Posts: n/a
 
      16th Mar 2009
This did the trick!

Thanks


"filo666" <(E-Mail Removed)> wrote in message
news:C9D2F502-0AE3-44CD-8948-(E-Mail Removed)...
>
> 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 With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      16th Mar 2009
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" <(E-Mail Removed)> wrote in message
> news:629C9228-92D5-41F9-9950-(E-Mail Removed)...
> > 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

>
>
>

 
Reply With Quote
 
Gerard Sanchez
Guest
Posts: n/a
 
      16th Mar 2009

That's okay.

Cheers!


"Jacob Skaria" <(E-Mail Removed)> wrote in message
news:2BF644FF-079A-41AB-A2DA-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
>> news:629C9228-92D5-41F9-9950-(E-Mail Removed)...
>> > 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

>>
>>
>>



 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      16th Mar 2009
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"
<(E-Mail Removed)> wrote:

>This did the trick!
>
>Thanks
>
>
>"filo666" <(E-Mail Removed)> wrote in message
>news:C9D2F502-0AE3-44CD-8948-(E-Mail Removed)...
>>
>> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick question - quick answer about assigning shortcut keys funkymonkUK Microsoft Excel Programming 1 13th Oct 2005 10:50 AM
Kind of quick Q, Need a quick A!! christopherpostill General 4 29th Jun 2004 10:29 PM
Quick lanuch question for the quick-witted Zengirl Windows XP Accessibility 8 28th Oct 2003 11:59 AM
Quick launch question for the quick-witted Zengirl Microsoft Access Getting Started 4 27th Oct 2003 04:58 PM
Quick Alt key question requiring quick answer... Joe Microsoft Windows 2000 Hardware 2 29th Aug 2003 06:41 AM


Features
 

Advertising
 

Newsgroups
 


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