无法将值从Private传递给Public Sub

我有一个工具,我正在devise用一组用户forms向用户提出一些问题。 该表单将通过从用户窗体传递一个整数结果到一个主要的sub,它将代码传递给一个工作表来生成一个分数。 我的问题是主模块没有得到从私有模块传递的值,这是怎么回事?

我首先尝试使用布尔值没有通过这样做,现在我正在尝试使用整数结果,也没有通过。

用户表格代码:

Private Sub Image1_Click() Select Case MsgBox("You have picked Thinks Commercially, is this correct?", vbYesNo, "Please Confirm") Case VbMsgBoxResult.vbYes Call Main.CountResults(ThinksCommerciallyInt = 1, OptimisesTalentInt = 0, DeliversPIInt = 0, DrivesExecutionInt = 0, ChampionsChangeInt = 0, OperatesColInt = 0) UserForm1.Hide UserForm2.Show Case VbMsgBoxResult.vbNo MsgBox ("Please Select Again") End Select End Sub 

主子代码

 Public Sub CountResults(ThinksCommerciallyInt As Integer, OptimisesTalentInt As Integer, DeliversPIInt As Integer, DrivesExecutionInt As Integer, ChampionsChangeInt As Integer, OperatesColInt As Integer) If ThinksCommerciallyInt = 1 Then ThisWorkbook.Worksheets("Config").Range("B2").Value = ThinksCommerciallyInt ThinksCommerciallyInt = ThinksCommerciallyInt + 1 ThinksCommerciallyInt = ThisWorkbook.Worksheets("Config").Range("B2").Value End If If OptimisesTalentInt = 1 Then ThisWorkbook.Worksheets("Config").Range("B3").Value = OptimisesTalentInt OptimisesTalentInt = OptimisesTalentInt + 1 OptimisesTalentInt = ThisWorkbook.Worksheets("Config").Range("B3").Value End If If DeliversPIInt = 1 Then ThisWorkbook.Worksheets("Config").Range("B4").Value = DeliversPIInt DeliversPIInt = DeliversPIInt + 1 DeliversPIInt = ThisWorkbook.Worksheets("Config").Range("B4").Value End If If DrivesExecutionInt = 1 Then ThisWorkbook.Worksheets("Config").Range("B5").Value = DrivesExecutionInt DrivesExecutionInt = DrivesExecutionInt + 1 DrivesExecutionInt = ThisWorkbook.Worksheets("Config").Range("B5").Value End If If ChampionsChangeInt = 1 Then ThisWorkbook.Worksheets("Config").Range("B6").Value = ChampionsChangeInt ChampionsChangeInt = ChampionsChangeInt + 1 ChampionsChangeInt = ThisWorkbook.Worksheets("Config").Range("B6").Value End If If OperatesColInt = 1 Then ThisWorkbook.Worksheets("Config").Range("B7").Value = OperatesColInt OperatesColInt = OperatesColInt + 1 OperatesColInt = ThisWorkbook.Worksheets("Config").Range("B7").Value End If End Sub 

在您的调用代码中:

 ThinksCommerciallyInt = 1 

应该

 ThinksCommerciallyInt := 1 

类似的其他参数