Hi All,
I've been using the following code for around 18 months and have had no problems, but suddenly it is taking longer than acceptable to run.
Sub Expenses_AddItem()
With Expenses
If .Range("E5").Value = Empty Then
MsgBox "Please enter a correct date"
Exit Sub
End If
If .Range("E7").Value = Empty Then
MsgBox "Please enter a Vendor"
Exit Sub
End If
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
ProdName = .Range("B6").Value 'Product Name
ProdDBRow = .Range("B7").Value 'Product DB Row
LastItemRow = .Range("E99999").End(xlUp).Row
.Range("E" & LastItemRow + 1).Value = ProdName
.Range("F" & LastItemRow + 1) = 1 'Quantity
.Range("I9").Copy
.Range("I" & LastItemRow + 1).PasteSpecial xlPasteFormulas
.Range("K9").Copy
.Range("K" & LastItemRow + 1).PasteSpecial xlPasteFormulas
.Range("L9").Copy
.Range("L" & LastItemRow + 1).PasteSpecial xlPasteFormulas
.Range("M9").Copy
.Range("M" & LastItemRow + 1).PasteSpecial xlPasteFormulas
.Range("N9").Copy
.Range("N" & LastItemRow + 1).PasteSpecial xlPasteFormulas
Application.CutCopyMode = False
Expense_SetFooter
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
.Range("F" & LastItemRow + 1).Select
End With
End Sub
Note that it appears to be the copy command that is causing the issue.
The computer that I am having the issues on is running Windows 11 Home build 22621, and Office 365 2309 build 16827.20130. I've tried a roll back to the version noted below and tried reinstalliing Office 365 but to no avail.
I've tested the model on another computer and works as per normal. This computer is running Windows 11 Pro build 22621, and Office 365 2308 build 16731.20234.
Any thoughts would be appreciated.
Thanks,
I've been using the following code for around 18 months and have had no problems, but suddenly it is taking longer than acceptable to run.
Sub Expenses_AddItem()
With Expenses
If .Range("E5").Value = Empty Then
MsgBox "Please enter a correct date"
Exit Sub
End If
If .Range("E7").Value = Empty Then
MsgBox "Please enter a Vendor"
Exit Sub
End If
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
ProdName = .Range("B6").Value 'Product Name
ProdDBRow = .Range("B7").Value 'Product DB Row
LastItemRow = .Range("E99999").End(xlUp).Row
.Range("E" & LastItemRow + 1).Value = ProdName
.Range("F" & LastItemRow + 1) = 1 'Quantity
.Range("I9").Copy
.Range("I" & LastItemRow + 1).PasteSpecial xlPasteFormulas
.Range("K9").Copy
.Range("K" & LastItemRow + 1).PasteSpecial xlPasteFormulas
.Range("L9").Copy
.Range("L" & LastItemRow + 1).PasteSpecial xlPasteFormulas
.Range("M9").Copy
.Range("M" & LastItemRow + 1).PasteSpecial xlPasteFormulas
.Range("N9").Copy
.Range("N" & LastItemRow + 1).PasteSpecial xlPasteFormulas
Application.CutCopyMode = False
Expense_SetFooter
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
.Range("F" & LastItemRow + 1).Select
End With
End Sub
Note that it appears to be the copy command that is causing the issue.
The computer that I am having the issues on is running Windows 11 Home build 22621, and Office 365 2309 build 16827.20130. I've tried a roll back to the version noted below and tried reinstalliing Office 365 but to no avail.
I've tested the model on another computer and works as per normal. This computer is running Windows 11 Pro build 22621, and Office 365 2308 build 16731.20234.
Any thoughts would be appreciated.
Thanks,