Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default difficulty with logical - if - and

I'm encountering difficulty with the following in VBA:

Quantity = cell B1
Price = cell B3
Gross amount = cell B5

How can I write the following logical if statement as follows:

If B1 is greater than 1, and B2 is greater than .0001, then (multiply
both together in B5, or else leave blank.

Thank you in advance.
Manuel
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default difficulty with logical - if - and

Assuming that B2 below was a typo,

=IF(AND(B11,B3.0001),B1*B3,"")

Alan Beban

billabong wrote:
I'm encountering difficulty with the following in VBA:

Quantity = cell B1
Price = cell B3
Gross amount = cell B5

How can I write the following logical if statement as follows:

If B1 is greater than 1, and B2 is greater than .0001, then (multiply
both together in B5, or else leave blank.

Thank you in advance.
Manuel


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default difficulty with logical - if - and

Hi,

If Range("b2").Value 1 And Range("b2").Value 0.0001 Then
Range("b5").Value = Range("b1").Value * Range("b2").Value
End If



--
JP

http://www.solutionsvba.com


<billabong wrote in message
...
I'm encountering difficulty with the following in VBA:

Quantity = cell B1
Price = cell B3
Gross amount = cell B5

How can I write the following logical if statement as follows:

If B1 is greater than 1, and B2 is greater than .0001, then (multiply
both together in B5, or else leave blank.

Thank you in advance.
Manuel



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default difficulty with logical - if - and

What's in B2?

I assume you mean B3 when you say B2. Otherwise, replace all the B3 with
B2.

=if(And(B11,B3.0001),B3*B1,"")

--
Regards,
Tom Ogilvy

<billabong wrote in message
...
I'm encountering difficulty with the following in VBA:

Quantity = cell B1
Price = cell B3
Gross amount = cell B5

How can I write the following logical if statement as follows:

If B1 is greater than 1, and B2 is greater than .0001, then (multiply
both together in B5, or else leave blank.

Thank you in advance.
Manuel



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default difficulty with logical - if - and

On Sat, 20 Sep 2003 17:20:16 -0400, "Jean-Paul Viel"
wrote:

Hi,

If Range("b2").Value 1 And Range("b2").Value 0.0001 Then
Range("b5").Value = Range("b1").Value * Range("b2").Value
End If


Hello:
I've entered the following:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("b2").Value 1 And Range("b2").Value 0.0001 Then
Range("b5").Value = Range("b1").Value * Range("b2").Value
End If
End Sub


However nothing appears in cell B5
even though I entered 4 in cell B1 and 1 in cell B2 on the
spreadsheet.

Thank you, Manuel


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default difficulty with logical - if - and

On Sat, 20 Sep 2003 17:20:16 -0400, "Jean-Paul Viel"
wrote:

Hi,

If Range("b2").Value 1 And Range("b2").Value 0.0001 Then
Range("b5").Value = Range("b1").Value * Range("b2").Value
End If



Please disregard my last posting, it works perfectly, thank you,
I just entered those variables in cells A1 and A2 instead of B1 and
B2. ooops...

Manuel
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
Difficulty with Sum+IF Function Gmania-1980 Excel Worksheet Functions 10 October 27th 09 07:49 PM
Help!!! - logical function for someone not very logical ECH123 Excel Worksheet Functions 3 May 11th 09 04:14 PM
Function Difficulty Johnnie[_2_] Excel Discussion (Misc queries) 5 October 20th 08 09:54 PM
Formula difficulty Pyrite Excel Discussion (Misc queries) 5 October 8th 08 08:13 PM
Difficulty with code Tom Ogilvy Excel Programming 3 August 29th 03 04:09 AM


All times are GMT +1. The time now is 12:28 PM.

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

About Us

"It's about Microsoft Excel"