Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Difficulty with Sum+IF Function | Excel Worksheet Functions | |||
Help!!! - logical function for someone not very logical | Excel Worksheet Functions | |||
Function Difficulty | Excel Discussion (Misc queries) | |||
Formula difficulty | Excel Discussion (Misc queries) | |||
Difficulty with code | Excel Programming |