ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   R1C1 Problem (https://www.excelbanter.com/excel-programming/385112-r1c1-problem.html)

Lacey

R1C1 Problem
 
Hi!

I have a macro that pastes a set of formula in a spreasheet and I'm
receiving an "End of Statement" error when the macro runs. The code looks
like this:

Range("B2").Select
ActiveCell.FormulaR1C1 = _

"=IF(("A2")<("A3"),""000"",IF((MID(E2,3,1))=""S"" ,(MID(E2,5,3)),""000""))"

Where I'm trying to compare cell A2 < A3, etc., etc. Why doesn't it like
this???



Tim Williams

R1C1 Problem
 
I'm guessing maybe this is what you meant?

"=IF((A2)<(A3),""000"",IF((MID(E2,3,1))=""S"",(MI D(E2,5,3)),""000""))"

--
Tim Williams
Palo Alto, CA


"Lacey" wrote in message ...
Hi!

I have a macro that pastes a set of formula in a spreasheet and I'm
receiving an "End of Statement" error when the macro runs. The code looks
like this:

Range("B2").Select
ActiveCell.FormulaR1C1 = _

"=IF(("A2")<("A3"),""000"",IF((MID(E2,3,1))=""S"" ,(MID(E2,5,3)),""000""))"

Where I'm trying to compare cell A2 < A3, etc., etc. Why doesn't it like
this???





Lacey

R1C1 Problem
 
I get a syntax error when I use (A2)< (A3). It doesn't like the ( ). Any
suggestions?

"Tim Williams" wrote:

I'm guessing maybe this is what you meant?

"=IF((A2)<(A3),""000"",IF((MID(E2,3,1))=""S"",(MI D(E2,5,3)),""000""))"

--
Tim Williams
Palo Alto, CA


"Lacey" wrote in message ...
Hi!

I have a macro that pastes a set of formula in a spreasheet and I'm
receiving an "End of Statement" error when the macro runs. The code looks
like this:

Range("B2").Select
ActiveCell.FormulaR1C1 = _

"=IF(("A2")<("A3"),""000"",IF((MID(E2,3,1))=""S"" ,(MID(E2,5,3)),""000""))"

Where I'm trying to compare cell A2 < A3, etc., etc. Why doesn't it like
this???






Dave Peterson

R1C1 Problem
 
..formulaR1C1 likes R1C1 reference style.
..formula likes A1 reference style

You have a followup post at your original thread.

Lacey wrote:

Hi!

I have a macro that pastes a set of formula in a spreasheet and I'm
receiving an "End of Statement" error when the macro runs. The code looks
like this:

Range("B2").Select
ActiveCell.FormulaR1C1 = _

"=IF(("A2")<("A3"),""000"",IF((MID(E2,3,1))=""S"" ,(MID(E2,5,3)),""000""))"

Where I'm trying to compare cell A2 < A3, etc., etc. Why doesn't it like
this???


--

Dave Peterson


All times are GMT +1. The time now is 11:16 AM.

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