I have 4 variables that are used between the vba that is run on the worksheet and the userform that elicits responses from the user. The four are declared in the general module like this:
I am populating the variables at various points in the code:
I have the public variables declare in the code for the UserForm also. I did this in the same manner as I did it on the Excel worksheet.
Here is my problem. When I run the program, the information that should be displayed is not appearing. I have checked the variable before the userform opens and it appears to be working. Do I need to set the variables in some other way? Do they need to be declared the same in both the general module and the user form. Can I get a variable back from the userform or do I need to just declare it?
I did this project on a Mac and what I am doing works there but not on a windows server. I am working with Excel 2010 on a Windows Server 2008 R2
Code:
Public KorS As String
Public ActivityID As String
Public varsaveme As String
I am populating the variables at various points in the code:
Code:
ActivityID = Left(Cells(6, 1), 6)
AdDate = Mid(Cells(6, 1), InStr(1, Cells(6, 1), "Begin Date:") + 12, 10)
If InStr(1, Cells(6, 1), "Comp1") > 1 Then
KorS = "Comp1"
Else
KorS = "Comp2"
End If
and
varsaveme = KorS & "_Annotations_" & Format(M, "00") & Format(D, "00") & YY & "_"
I have the public variables declare in the code for the UserForm also. I did this in the same manner as I did it on the Excel worksheet.
Here is my problem. When I run the program, the information that should be displayed is not appearing. I have checked the variable before the userform opens and it appears to be working. Do I need to set the variables in some other way? Do they need to be declared the same in both the general module and the user form. Can I get a variable back from the userform or do I need to just declare it?
I did this project on a Mac and what I am doing works there but not on a windows server. I am working with Excel 2010 on a Windows Server 2008 R2
Last edited: