Hoping for some VBA assistance. I have a worksheet that contains a master set of formulas in cells AE2:AZ2. Users copy a data file into cells AA5:AD-- (ending row varies). Once the data is copied, the user clicks a button to 'refresh formulas', which then copies the master formulas from row 2 into the data rows AE5:AZ--. It also then replaces the live formulas with values. This macro works fine for most data files imported, however there are a few data files that contain too much data & when the user attempts to run the 'refresh formula' macro, Excel comes back with a "not enough resources" error & the macro bombs. Below is the code I am currently using for this process. Is there a more efficient way to construct my code to avoid the resource error? I've heard there is a VBA procedure that copies data out into array, then pulls it back into Excel (I think??), but I am unfamiliar with this process. Any help would be MUCH appreciated!!
Sub Copy_Formulas()
Dim Numrecords
Numrecords = Range("AE1").Value 'cell AE1 is a formula that recognizes #of data records copied into the file. This value is used for multiple purposes.
Range("AE2:AZ2").Copy Range("AE5:AZ" & CStr(Numrecords + 4))
Range("AE5:AZ" & CStr(Numrecords + 4)).Value = Range("AE5:AZ" & CStr(Numrecords + 4)).Value
Application.CutCopyMode = False
End Sub