Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
help writing formula
The current formula residing in about 200 cells is
='Daily N '!AN13 I'm trying to write a macro that will change that formula to =IF(OR(B9=6,B9=7),"",'Daily N '!AN13) Here is my code ActiveCell.Formula = "=IF(OR(B" & ActiveCell.Row & "=6,B" & ActiveCell.Row & "=7),""," & strHoldFormula & ")" My problem is "=7),""," Since quotes are used to identify the beginning and end of a text string within a formula, how do you use quotes within a formula to tell Excel to display nothing if a condition is true? -- Ryan Proudfit |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
help writing formula
To include a " character in a VBA string, use two " characters.
E.g., ActiveCell.Formula = "=IF(OR(B" & ActiveCell.Row & "=6,B" & _ ActiveCell.Row & "=7),""""," & strHoldFormula & ")" -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Ryan Proudfit" wrote in message ... The current formula residing in about 200 cells is ='Daily N '!AN13 I'm trying to write a macro that will change that formula to =IF(OR(B9=6,B9=7),"",'Daily N '!AN13) Here is my code ActiveCell.Formula = "=IF(OR(B" & ActiveCell.Row & "=6,B" & ActiveCell.Row & "=7),""," & strHoldFormula & ")" My problem is "=7),""," Since quotes are used to identify the beginning and end of a text string within a formula, how do you use quotes within a formula to tell Excel to display nothing if a condition is true? -- Ryan Proudfit |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help writing a formula | Excel Discussion (Misc queries) | |||
Need help writing a formula | Excel Worksheet Functions | |||
Help in writing a formula | Excel Discussion (Misc queries) | |||
Writing a Formula | Excel Discussion (Misc queries) | |||
writing a formula | Excel Discussion (Misc queries) |