Formulas not working...then working?

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!
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top