Refer to a worksheet from a userform

L

leonidas

Hi,

I have a commandbutton(1) on a worksheet. When I click on this
commandbutton(1) a userform will show.
When I click on the commandbutton(2) OK on this userform it should look
for the name of the worksheet I clicked commandbutton(1). The code is
below. The only problem is, nothing happens.
Can someone help me solve this problem? Thanks in advance!


Code:
--------------------
Private Sub CommandButton1_Click()

If ActiveSheet.Name = "Begroting Calc Won" Then
Application.OnTime Now, "BegrotingWVBWonMaken"
Else
If ActiveSheet.Name = "Begroting Calc Uti" Then
Application.OnTime Now, "BegrotingWVBUtiMaken"
End If
End If

End Sub
 
B

Bob Phillips

Works fine for me (XP, XL 2002)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top