View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
lcaretto lcaretto is offline
external usenet poster
 
Posts: 9
Default User form varible passing

Try making global_var1 a public variable so that it will be visible outside
of module1.

"miek" wrote:

In my VBA module "module1" i have a global varible

Private global_var1 as boolean
I initialize it in the main Subroutine
global_var1 = false
Then I call my userform, which has a cmdbtn "Doit"
With Question_Form
Load Question_Form
.Show
End With
My userform cmdbtn code is
Private Sub Always_Btn_Click()
global_var1 = True
Question_Form.Hide
End Sub

However, when my userform returns "global_var1" remains = false

How do i pass global_var1 back to module1?
Thanks