vba_newbie_canada
New Member
- Joined
- Mar 4, 2009
- Messages
- 6
Hi,
I have a line of code that puts formulas in row 2 of columns X - AE and then copies it to the last row in the data set (in this case row 6028). Sometimes the value from the formula appears, sometimes it doesn't. Even more peculiar is that it works up to row 452 (can change) but displayes 0's after that. When I place my cursor in the cell the formula is there AND when I hit enter with the cursor in the cell, the formula does return the correct value. And I can get the rest of the values this way too but obviously I don't want to do this.
I close the file and rerun the code and will get all of the values. Then I will try again and it won't work. It's hit or miss. I also have 5 other formulas in adjacent columns and they work fine, all of the time.
Code:
LastRow = Range("A2").End(xlDown).Row
Range("X2:X" & LastRow).FormulaR1C1 = "=RC[-21]&"" / ""&TEXT(RC[-23],""YYYY-MM-DD"")&"" / ""&RC[-22]"
Has anyone experienced this before?
Thanks!
I have a line of code that puts formulas in row 2 of columns X - AE and then copies it to the last row in the data set (in this case row 6028). Sometimes the value from the formula appears, sometimes it doesn't. Even more peculiar is that it works up to row 452 (can change) but displayes 0's after that. When I place my cursor in the cell the formula is there AND when I hit enter with the cursor in the cell, the formula does return the correct value. And I can get the rest of the values this way too but obviously I don't want to do this.
I close the file and rerun the code and will get all of the values. Then I will try again and it won't work. It's hit or miss. I also have 5 other formulas in adjacent columns and they work fine, all of the time.
Code:
LastRow = Range("A2").End(xlDown).Row
Range("X2:X" & LastRow).FormulaR1C1 = "=RC[-21]&"" / ""&TEXT(RC[-23],""YYYY-MM-DD"")&"" / ""&RC[-22]"
Has anyone experienced this before?
Thanks!