Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In MS Access I was able to do
if A + B = C then do action else do another action end if Can I do the same in Excel for example: if Cell.A1 + Cell.A2 = Cell.A3 then What would the VBA look like? Thank you for your time, Ryan |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way
If Range("A1") + Range("A2") = Range("A3") Then 'do things Else 'Do different things End If Mike "Ryan W" wrote: In MS Access I was able to do if A + B = C then do action else do another action end if Can I do the same in Excel for example: if Cell.A1 + Cell.A2 = Cell.A3 then What would the VBA look like? Thank you for your time, Ryan |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I did this using several variations so you can see that there is more than
one way to skin the cat. sub doit() if range("a1")+cells(2,1)=cells(3,"a") then msgbox "OK" else msgbox "not ok" end if -- Don Guillett Microsoft MVP Excel SalesAid Software "Ryan W" wrote in message ... In MS Access I was able to do if A + B = C then do action else do another action end if Can I do the same in Excel for example: if Cell.A1 + Cell.A2 = Cell.A3 then What would the VBA look like? Thank you for your time, Ryan |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A neat way to demonstrate 3 ways :)
"Don Guillett" wrote: I did this using several variations so you can see that there is more than one way to skin the cat. sub doit() if range("a1")+cells(2,1)=cells(3,"a") then msgbox "OK" else msgbox "not ok" end if -- Don Guillett Microsoft MVP Excel SalesAid Software "Ryan W" wrote in message ... In MS Access I was able to do if A + B = C then do action else do another action end if Can I do the same in Excel for example: if Cell.A1 + Cell.A2 = Cell.A3 then What would the VBA look like? Thank you for your time, Ryan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
#N/A in calculations | Excel Worksheet Functions | |||
Calculations seem to be off... | Excel Discussion (Misc queries) | |||
! in Calculations | Excel Discussion (Misc queries) | |||
Help with PV calculations | Excel Worksheet Functions |