In support of this main Forum post:
http://www.eileenslounge.com/viewtop...297074#p297074 http://http://www.eileenslounge.com/viewtop...297074#p297074
Second simplified Solution
I think in the first solution I made initially a mistake in trying to set the pseudo public variables, *** and so went off in a tangent using the Application.Run stuff. You don’t need any of that and can forget the two macros that fill the variables as well.
You just need this
Worksheet code module, Sheet1 ( in PurseWayDoughPublicVariables.xls )
Workbook code module, ThisWorkbook ( in PurseWayDoughPublicVariables.xls )Code:Public C1 As String
Code:Public C2 As String
And then the other macros are like
Code:Private Sub CommandButton1_Click() Select Case Me.CheckBox1 Case True 'C1 = "yes" ' Application.Run Macro:="'" & ThisWorkbook.Path & "\" & "PurseWayDoughPublicVariables.xls'!Sheet1.PhilC1", Arg1:="Yus" Let Workbooks("PurseWayDoughPublicVariables.xls").Worksheets("Sheet1").C1 = "Yus" End Select Select Case Me.CheckBox2 Case True 'C2 = "yes" ' Application.Run Macro:="'" & ThisWorkbook.Path & "\" & "PurseWayDoughPublicVariables.xls'!ThisWorkbook.PhilC2", Arg1:="Ja" Let Workbooks("PurseWayDoughPublicVariables.xls").C2 = "Ja" End Select Unload Me Call Sheet2.Fi_l End SubCode:Sub Fi_l() 'Act_ive 'Let Range("A2").Resize(10).Value = C1 Let Range("A2").Resize(10).Value = Workbooks("PurseWayDoughPublicVariables.xls").Worksheets("Sheet1").C1 'let Range("B2").Resize(10).Value = C2 Let Range("B2").Resize(10).Value = Workbooks("PurseWayDoughPublicVariables.xls").C2 End Sub




Reply With Quote
Bookmarks