Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi I need to add a formula to a cell ( actually a range of cells) uing VB. The formula is =IF($U6="","",IF(OR($T6="Yes",$U6="Yes"),"HICA",IF ($E6="No Notice","CALL","Notice"))) I would like to use something like: Range("V2").Formula = "=IF(OR(T2="Yes",U2="Yes"),"HICA",IF(E2="No Notice","CALL","Notice"))" My problem is that the quotes in the formula are read as the end of the string in the vb. Could anyone help please? Thanks -- Willow ------------------------------------------------------------------------ Willow's Profile: http://www.excelforum.com/member.php...o&userid=16070 View this thread: http://www.excelforum.com/showthread...hreadid=564642 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() You need to use double (double double!) quotes: Range("V2").Formula = "=IF(OR(T2=""Yes"",U2=""Yes""),""HICA"",IF(E2= ""No Notice"",""CALL"",""Notice""))" -- lucidr ------------------------------------------------------------------------ lucidr's Profile: http://www.excelforum.com/member.php...o&userid=36699 View this thread: http://www.excelforum.com/showthread...hreadid=564642 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks - I knew it was something simple. -- Willow ------------------------------------------------------------------------ Willow's Profile: http://www.excelforum.com/member.php...o&userid=16070 View this thread: http://www.excelforum.com/showthread...hreadid=564642 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Willow, The easiest way to get this right is to turn on the recorder and then enter the formula into the cell. Kind regards, NickH |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Willow, The easiest way to get this right is to turn on the recorder and then enter the formula into the cell. Kind regards, NickH |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
adding a formula around a cell reference | Excel Discussion (Misc queries) | |||
Adding Contents of a cell to a formula | Excel Discussion (Misc queries) | |||
formula for adding every other cell in Excel | Excel Worksheet Functions | |||
adding a formula in a cell but when cell = 0 cell is blank | Excel Worksheet Functions | |||
Adding new sheet's cell value to old formula | Excel Programming |