Dear Excel Ninjas,
I am facing a challenge at work. I am getting the error in the subject line.
Kindly see my code below and please help.
I am facing a challenge at work. I am getting the error in the subject line.
Kindly see my code below and please help.
Code:
Sub Loop_Macro()
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
ActiveWindow.DisplayHeadings = False
ActiveWindow.DisplayHorizontalScrollBar = False
ActiveWindow.DisplayWorkbookTabs = False
Application.DisplayFormulaBar = False
Application.DisplayFullScreen = True
'Daily Sales
Do
Worksheets("Sales for the day").Activate
Application.Wait (Now + TimeValue("0:00:45"))
Sheets("Todays sales").Activate
Application.Wait (Now + TimeValue("0:00:45"))
Sheets("Projected volume").Activate
Application.Wait (Now + TimeValue("0:00:45"))
Sheets("Yesterdays sales").Activate
Application.Wait (Now + TimeValue("0:00:45"))
'Monthly sales
Worksheets("Sales for the month").Activate
Application.Wait (Now + TimeValue("0:00:45"))
Sheets("MTD Sales").Activate
Application.Wait (Now + TimeValue("0:00:45"))
Sheets("MTD Lite RB").Activate
Application.Wait (Now + TimeValue("0:00:45"))
Sheets("MTD Pie").Activate
Application.Wait (Now + TimeValue("0:00:45"))
Sheets("Lite comparison graph").Activate
Application.Wait (Now + TimeValue("0:00:45"))
Sheets("Volume split").Activate
Application.Wait (Now + TimeValue("0:00:45"))
Sheets("Gold graph").Activate
Application.Wait (Now + TimeValue("0:00:45"))
Sheets("Silver graph").Activate
Application.Wait (Now + TimeValue("0:00:45"))
Sheets("Summary graph").Activate
Application.Wait (Now + TimeValue("0:00:45"))
'Ytd Sales
Worksheets("Sales for the year").Activate
Application.Wait (Now + TimeValue("0:00:45"))
Sheets("YTD Pie").Activate
Application.Wait (Now + TimeValue("0:00:45"))
Sheets("YTD Sales").Activate
Application.Wait (Now + TimeValue("0:00:45"))
'Refresh code
ThisWorkbook.RefreshAll
Sheets("Sales for the day").Calculate
Sheets("Sales for the month").Calculate
Sheets("Sales for the year").Calculate
Sheets("Projected data").Calculate
Sheets("Gold customers").Calculate
Sheets("Silver Customers").Calculate
Sheets("Bronze").Calculate
Sheets("August target").Calculate
Sheets("Lite comparison data").Calculate
Sheets("YTD sales").Calculate
Loop
End Sub