Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
hi
in the following program if there is no value in the cells a1 and b1 it returns 0 Public Sub Add2Cells() Range("C1").Value = Range("A1").Value + Range("B1").Value End Sub i need only the output if the both the cells have the data will you can tell me that |
#2
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Public Sub Add2Cells()
If Range("A1").Value < "" And .Range("B1").Value < "" Then Range("C1").Value = Range("A1").Value + Range("B1").Value End If End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "kaja" wrote in message ... hi in the following program if there is no value in the cells a1 and b1 it returns 0 Public Sub Add2Cells() Range("C1").Value = Range("A1").Value + Range("B1").Value End Sub i need only the output if the both the cells have the data will you can tell me that |
#3
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
I think you included an extra period
..Range("B1").Value < "" probably s/b Range("B1").Value < "" "Bob Phillips" wrote: Public Sub Add2Cells() If Range("A1").Value < "" And .Range("B1").Value < "" Then Range("C1").Value = Range("A1").Value + Range("B1").Value End If End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "kaja" wrote in message ... hi in the following program if there is no value in the cells a1 and b1 it returns 0 Public Sub Add2Cells() Range("C1").Value = Range("A1").Value + Range("B1").Value End Sub i need only the output if the both the cells have the data will you can tell me that |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
sum by coding | New Users to Excel | |||
How to fix the coding? | Excel Worksheet Functions | |||
How to fix the coding? | Excel Worksheet Functions | |||
coding | Excel Discussion (Misc queries) | |||
Coding | Excel Discussion (Misc queries) |