Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The following IF function works in Excel, but when I copy it into VBA so I
can excute it in a range it will not work. Range("p6:p40").Formula = "=IF(C6="","",(P5+O6)-M6)" I think VBA has a problem with "" meaning an empty cell. Can someone tell me what I can substitute for "" so my formula will work in VBA? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try the below.. VBA recognizes double double quote as a single double quote
Range("p6:p40").Formula = "=IF(C6="""","""",(P5+O6)-M6)" If this post helps click Yes --------------- Jacob Skaria "ManhattanRebel" wrote: The following IF function works in Excel, but when I copy it into VBA so I can excute it in a range it will not work. Range("p6:p40").Formula = "=IF(C6="","",(P5+O6)-M6)" I think VBA has a problem with "" meaning an empty cell. Can someone tell me what I can substitute for "" so my formula will work in VBA? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you...that solved the problem
"Jacob Skaria" wrote: Try the below.. VBA recognizes double double quote as a single double quote Range("p6:p40").Formula = "=IF(C6="""","""",(P5+O6)-M6)" If this post helps click Yes --------------- Jacob Skaria "ManhattanRebel" wrote: The following IF function works in Excel, but when I copy it into VBA so I can excute it in a range it will not work. Range("p6:p40").Formula = "=IF(C6="","",(P5+O6)-M6)" I think VBA has a problem with "" meaning an empty cell. Can someone tell me what I can substitute for "" so my formula will work in VBA? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
How I prevent a "0" when a linked cell is empty? | Excel Worksheet Functions | |||
Return an absolutely empty cell ... but not "" | Excel Worksheet Functions | |||
Can IF function return an empty cell? (not "") | Excel Worksheet Functions | |||
Excel: can "go to adjacent empty cell" double-click be disabled? | Excel Discussion (Misc queries) |