Sheet1 or Sheet(1) "Sub or Function Not defined"

Shiseiji

Board Regular
Joined
Oct 23, 2009
Messages
214
Office Version
  1. 2019
Platform
  1. Windows
What am I missing? First time I've had this error. Actual statement causing the error is almost at end of code identified by "'===Errors===" but I've posted it all.
TIA

VBA Code:
Option Explicit
Sub m_Make_File()
    ' 20211118
    ' Set start ws to hidden
'----
     Call CleanWindow_m ' opens the blank worksheet to minimize screen refresh.
'---- Post after "CleanWindow" and prior to module
     Application.ScreenUpdating = True
     Application.StatusBar = "Starting conversion of the file."
     Application.ScreenUpdating = False
     Application.DisplayAlerts = False
     Application.DisplayStatusBar = True
'
    Call m_SaveLocalWbasXLSM
'
     Application.ScreenUpdating = True
     Application.StatusBar = "Importing the file."
     Application.ScreenUpdating = False
     Application.DisplayAlerts = False
     Application.DisplayStatusBar = True
'+++
    Call GetFileList_m
    Call m_RemoveConnections
    Call AutoImportFile_m
'+++
'----
     Application.ScreenUpdating = True
     Application.StatusBar = "Modifying the file headers."
     Application.ScreenUpdating = False
     Application.DisplayAlerts = False
     Application.DisplayStatusBar = True
'+++
    Call ReNameHeaders_m 'creates rng_HeaderRow & rng_tbl
'+++
'----
     Application.ScreenUpdating = True
     Application.StatusBar = "Re-ording the file columns."
     Application.ScreenUpdating = False
     Application.DisplayAlerts = False
     Application.DisplayStatusBar = True
'+++
     Call OrderColumns_m
'+++
     Application.ScreenUpdating = True
     Application.StatusBar = "Converting Employee ID Number to Text."
     Application.ScreenUpdating = False
     Application.DisplayAlerts = False
     Application.DisplayStatusBar = True
'+++
     Call MakeRanges_m ' also makes employee ID text
'+++
     Application.ScreenUpdating = True
     Application.StatusBar = "Applying easy to read formating."
     Application.ScreenUpdating = False
     Application.DisplayAlerts = False
     Application.DisplayStatusBar = True
'+++
     Call ExcelDiet_m
'+++
     Call FormatReport_m
'+++
     Call m_SaveEnabledWBasXLSM
     Call SaveFinalasCSV_m
'+++
    Application.EnableEvents = True
    Application.ScreenUpdating = True
    Application.StatusBar = " "
    Application.Wait (Now + TimeValue("00:00:1"))
'
'
'===Errors===
    'Sheet1.Visible = xlSheetVisible
    Sheet(1).Visible = xlSheetVisible
    'Sheet1.Activate
    Sheet(1).Activate
'===
'
'
    Application.Wait (Now + TimeValue("00:00:2"))
    ActiveWindow.SmallScroll down:=3
    ActiveWindow.SmallScroll down:=-3
    ws_Blank.Visible = xlVeryHidden
    Application.StatusBar = " "
    Application.Wait (Now + TimeValue("00:00:2"))
    Application.StatusBar = "Completed conversion of file."
    Application.StatusBar = ""
    Dim answer As Integer
    answer = MsgBox("Completed", vbOKOnly, "Report Conversion Completed")
    ThisWorkbook.Saved = True
'
End Sub

TIA
Ron
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
It should be Sheets (plural) not sheet.
 
Upvote 0
Solution
😳 Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh. Blinding Flash of the Obvious! (BFO)

As always, thanks Fluff!!!!
Question, what can be done to not have to use the index number?
 
Upvote 0
You could use the sheet name.
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top