December 12, 2016
I've a script to copy a formula from cell A15 of worksheet "Onepage" and past it onto a specific cell of the rest workseets starting sheet #4. It has been running smoothly for qute a long time. However, after making some chanages to my workbook last weekend without touching VBA at all, an automation error as highlighted below in red color came to me. May I know what's the problem and how to solve it? Many thnaks.
Sub UpdatePrice1()
Dim WS_Count As Integer
Dim I As Integer
Dim pos As Long
Application.ScreenUpdating = False
Sheets("Onepage").Select
pos = Date - 44560
Range("A15").Select
Selection.Copy
WS_Count = ActiveWorkbook.Worksheets.Count
For I = 4 To WS_Count
Worksheets(I).Select
Range("B" & pos).Select
ActiveSheet.Paste
Next I
Sheets("Onepage").Select
Application.CutCopyMode = False
Application.ScreenUpdating = True
MsgBox "Prices updating..."
End Sub
1 Guest(s)