View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_5_] Bob Phillips[_5_] is offline
external usenet poster
 
Posts: 620
Default Passing ARGUMENTS between event procedures of a USERFORM

Jason,

The Textbox Change event does not have arguments, it is automatically
triggered by a change in the textbox. It seems you want to load it, so why
not just try

Private Sub ChkAutofit_Click()
TextBox1.Text = instrAutofit
End Sub

Private Sub ChkAutoSum_Click()
TextBox1.Text = instrAutoSum
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"jason" wrote in message
om...
in a normal module I have:

Public Const instrAutofit As String _
= "This will add a control which will autofit the columns" _
& "and rows of the activesheest used range "

Public Const instrAutoSum As String _
= "This will add a control to the menu that appears when you

right" _
& "click a cell on a worksheet.It will have the same

functionality" _
& "as the usual Autosum control that is usually situated on the

toolbar"

In a Userform module I have:

Option Explicit

Private Sub ChkAutofit_Click()
Call TextBox1_Change(instrAutofit)
End Sub

Private Sub ChkAutoSum_Click()
Call TextBox1_Change(instrAutoSum)
End Sub

Private Sub TextBox1_Change(xxx As String)
TextBox1 = xxx
End Sub

Why doesn't this work??
Should I be using different events?

Jason