我試圖通過傳遞一定SHEETNAME作爲參數調用一個子程序,但我收到以下錯誤:傳遞表要子程序
Object doesn't support this property or method
這裏是我的代碼:
Public Sub PerformanceLeague()
Dim wsPerformanceLeague As Worksheet
Set wsPerformanceLeague = Worksheets("PerformanceLeague")
SetHeadings wsPerformanceLeague
End Sub
Public Sub SetHeadings(sSheet As Worksheet)
Dim headers() As Variant
Dim ws As Worksheet
Dim wb As Workbook
Application.ScreenUpdating = False
End Sub
我試圖調用的子程序,如下爲好,但收到同樣的錯誤:
Call SetHeadings(wsPerformanceLeague)
'wsPerformanceLeague =工作表( 「PerformanceLeague」)'將其更改爲'設置wsPerformanceLeague =工作表( 「PerformanceLeague」) ' –
同時在'Dim wsPerformanceLeague作爲工作表'聲明它' –
您能告訴我們您收到哪條錯誤消息嗎? –