Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
dynamic formula
hi,
i have the following: Range("AJ8:AJ" & lastrecordNew2).Select Selection.Formula = "=IF(ISERROR(BB8/BC8),'No Data',BB8/BC8)" but i have a problem with this because its not working right. i think it has something to do with the syntax or something around the No Data. how can i fix this? thanks in advance, geebee |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
dynamic formula
Apostrophes do not delimit text in Excel; quote marks do. However, quote
marks inside of a String constant must be doubled up in order for VB to treat them as real quote marks and not text String delimiters. Try it this way... Range("AJ8:AJ" & lastrecordNew2).Formula = _ "=IF(ISERROR(BB8/BC8),""No Data"",BB8/BC8)" Also notice that there is no reason to select the cell in order to address one of its properties. Rick "geebee" (noSPAMs) wrote in message ... hi, i have the following: Range("AJ8:AJ" & lastrecordNew2).Select Selection.Formula = "=IF(ISERROR(BB8/BC8),'No Data',BB8/BC8)" but i have a problem with this because its not working right. i think it has something to do with the syntax or something around the No Data. how can i fix this? thanks in advance, geebee |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
dynamic formula
Dim LastRecordNew2 As Long LastRecordNew2 = 33 With ActiveSheet .Range("AJ8:AJ" & LastRecordNew2).Formula _ = "=IF(ISERROR(BB8/BC8),""No Data"",BB8/BC8)" End With You have to use " for strings (not apostrophes) in your formulas. And in VBA, you have to double them up to get one. geebee wrote: hi, i have the following: Range("AJ8:AJ" & lastrecordNew2).Select Selection.Formula = "=IF(ISERROR(BB8/BC8),'No Data',BB8/BC8)" but i have a problem with this because its not working right. i think it has something to do with the syntax or something around the No Data. how can i fix this? thanks in advance, geebee -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to convert a static formula to dynamic formula ? | Excel Worksheet Functions | |||
Dynamic Formula with Dynamic Address | Excel Worksheet Functions | |||
Help with copying dynamic column selected based on remote cell value and dynamic formula fill | Charts and Charting in Excel | |||
Help with copying dynamic column selected based on remote cell value and dynamic formula fill | Excel Programming | |||
Dynamic Range with unused formula messing up x axis on dynamic graph | Charts and Charting in Excel |