johnmerlino
Board Regular
- Joined
- Sep 21, 2010
- Messages
- 94
Hey all,
I'm trying to convert a formula into a macro. But I am having difficulty having the formula apply to each row as long as there is content in column a. Once column a is empty, then I want to macro to end.
This is what I have:
This doesn't work though. It gives an object-defined error.
I'm trying to convert a formula into a macro. But I am having difficulty having the formula apply to each row as long as there is content in column a. Once column a is empty, then I want to macro to end.
This is what I have:
Code:
Sub prepare4Sweep()
LR = Range("A" & Rows.Count).End(xlUp).Row
Range("D1:D" & LR).FormulaR1C1 = _
"=IF(RC[-10]=""=RC[-2] & "" "" & RC[-3] & "" "" & RC[-1]"
Range("D1:D" & LR).Copy
Range("E1").PasteSpecial xlPasteValues
End Sub
This doesn't work though. It gives an object-defined error.