ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   vba formula error (https://www.excelbanter.com/excel-programming/429545-vba-formula-error.html)

RobcPettit[_2_]

vba formula error
 
hi, im using ActiveCell.FormulaR1C1 = "=IF(Results!R[-1]C[1]
<"""",Results!R[-1]C[1],"""")" which should give me =IF(Results!
A3<"",Results!A3,"") but instead gives me =IF
(Results!'A3'<"",Results!'A3',""). Any ideas how to get rid of those
' .
Regards Robert

[email protected]

vba formula error
 
Sorry I discovered my error I was using Activecell.FormulaR1C1= "=IF
(Results!'A3'<"",Results!'A3',"")" were I should have used
Activecell = "=IF(Results!'A3'<"",Results!'A3',"")".
Regards robert

Dave Peterson

vba formula error
 
I don't think so.

If you're using .formulaR1C1, then you should use R1C1 reference style.

Maybe you meant that this correction worked:

Activecell.Formula = "=IF(Results!A3<"""",Results!A3,"""")"

You have to double up those double quotes, too.

" wrote:

Sorry I discovered my error I was using Activecell.FormulaR1C1= "=IF
(Results!'A3'<"",Results!'A3',"")" were I should have used
Activecell = "=IF(Results!'A3'<"",Results!'A3',"")".
Regards robert


--

Dave Peterson

Patrick Molloy

vba formula error
 
ActiveCell.FormulaR1C1 = "=IF(Results!R[-1]C[1] <
"""",Results!R[-1]C[1],"""")"

this does result in correct formula.



"RobcPettit" wrote in message
...
hi, im using ActiveCell.FormulaR1C1 = "=IF(Results!R[-1]C[1]
<"""",Results!R[-1]C[1],"""")" which should give me =IF(Results!
A3<"",Results!A3,"") but instead gives me =IF
(Results!'A3'<"",Results!'A3',""). Any ideas how to get rid of those
' .
Regards Robert




All times are GMT +1. The time now is 01:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com