1

I have 2 columns (column F and G), let's say they both go up to row 10. In row S, I want a concatenate statement: F(G)

I've tried:

SHEET.range("S2:S2" & LastRow).FormulaR1C1 = "=CONCATENATE(RC[-13],""("",RC[-12],"")"")"

and

SHEET.column(18).FormulaR1C1 = "=CONCATENATE(RC[-13],""("",RC[-12],"")"")"

The problem with either is that after the 10th row, the formula keeps running such that every cell goes "()". How do I edit the macro to end when there's no more data in column F and G?

1 Answer 1

2

with:

range("S2:S2" & LastRow)

if LastRow is 10 then the string will be S2:S210 as you have the 2 in the second reference. You want to remove that:

range("S2:S" & LastRow)

So:

SHEET.range("S2:S" & LastRow).FormulaR1C1 = "=CONCATENATE(RC[-13],""("",RC[-12],"")"")"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.