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
It's my pleasure to report here I've fixed the automation error happened to me. The reason for that error is the sheet code name "Sheet3" was not in place after I added "on error resume next" statement then I found it's missing among 16 worksheets.