View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
donwb donwb is offline
external usenet poster
 
Posts: 81
Default Run time error message???....Help!!

Hi Hoyos

I created 2 Userforms 1 with 2 command buttons,
and the other blank.
On UF1,
Command button 2 is the exit or close
Command Button 1 is used to call up a second Userform2

This is the code in UF1:-
Private Sub CommandButton1_Click()
UserForm2.Show
End Sub

Private Sub CommandButton2_Click()
Unload UserForm1
End Sub

A code module opens UF1:-

Sub OpenUF1)
UserForm1.Show
End Sub

This worked OK for me.
donwb


"hoyos" wrote in message
...
With the following code set in a userform:

Private Sub CommandButton1_Click()
UserForm9.Show
End Sub

When ever I press commandbutton1 I get the following error message:

Run-Time '1004'
Application-defined or object-defined error

Any fix for this?