Jus guessing, but I think it'd work better to put the 5 into g1 before showing the user form

Public g1 As Double Sub Sim()
g1=5
Form2.Show End Sub