I have some VBA code written which prepares a csv file for me so I can run individual macros on it for each model I have. The issue is every now and then, columns have duplicate data all the way down, rather than results of the formula copied down.
At first I thought it must be a memory issue, as if I rebooted and ran it again, it performed perfectly. This morning, regardless of how many times I rebooted, even once booting into Safe Mode on my Mac, it still did the same errors in the same columns.
What appears to happen on those times when it doesn't work correctly is in the CopyFormulaDownToLastRowOfData macro. It should be copying the results of the formula all the way down; so the results in each cell should be the result for that cell, but instead, it ends up with the result of the first cell copied all the way down. Here is the code for that particular macro
Sub CopyFormulaDownToLastRowOfData()
Dim LastRow As Long
LastRow = Cells.Find("*", , xlValues, , xlRows, xlPrevious).Row
With Range(ActiveCell, Cells(LastRow, ActiveCell.Column))
.FillDown
.Value = .Value
End With
End Sub
Can anyone see any issues with it?
Thanks in advance