Thread: Load User form
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Load User form

Hi Bakar,

Am Fri, 19 Oct 2012 10:30:38 +0000 schrieb Bakar:

What I want is(A) I click to open the user form (B) I insert the value
(C)
I click ok the value transfer to cellA1 and the userform close and when
i reopen it the text box is empty


you can show the userform by double clicking in your sheet. Put
foolwoing code in the code module of your sheet:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel As Boolean)
UserForm1.Show
Cancel = True
End Sub

and for your OK button, use:

Private Sub cmdOK_Click()
[A1] = TextBox1.Text
Unload UserForm1
End Sub


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2