Greetings Everyone,
I have a workbook where production values are entered for different production lines daily. The database is set up to insert a new blank line just beneath the header row with formulas to make some calculations on the production values when entered. The sheet has grown to be 72 columns wide and currently about 4,900 rows deep and there are about 40 formulas per line giving me a total number of formulas of about 196,000 and this number grows each day as production is entered. This number of calculations is slowing down the line insertion macro to the point it takes nearly 8.5 seconds to insert a row using the macro:
Sub Production_Analysis26()
Dim StartTime As Double
Dim EndTime As Double
Dim RunTime As Double
Dim LCol As Long
Dim rConstants As Range
StartTime = Timer
Sheets("Variance Register").Select
Application.ScreenUpdating = False
Application.DisplayAlerts = False
LCol = Cells(5, Columns.Count).End(xlToLeft).Column
Set rConstants = Cells(6, 1).Resize(1, LCol).SpecialCells(xlCellTypeConstants)
Cells(7, 1).Resize(1, LCol).Insert shift:=xlDown
Cells(6, 1).Resize(1, LCol).Copy Range("A7")
rConstants.ClearContents
Application.ScreenUpdating = True
Application.DisplayAlerts = True
EndTime = Timer
RunTime = EndTime - StartTime
MsgBox "Macro completed in " & RunTime & " Seconds"
End Sub
What I am wanting to accomplish is to pick an arbitrary length of time, say 90 days, to keep the formulas intact then just do a copy pastevalue to convert the formulas to constants but I am at a loss as to how to do this without looping through the entire sheet to evaluate the dates.
I would appreciate any help or suggestions!
Thanks
Bookmarks