Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Refer to a worksheet from a userform


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
--------------------


--
leonidas
------------------------------------------------------------------------
leonidas's Profile: http://www.excelforum.com/member.php...o&userid=35375
View this thread: http://www.excelforum.com/showthread...hreadid=564242

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Refer to a worksheet from a userform

Works fine for me (XP, XL 2002)

--
HTH

Bob Phillips

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

"leonidas" wrote in
message ...

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
--------------------


--
leonidas
------------------------------------------------------------------------
leonidas's Profile:

http://www.excelforum.com/member.php...o&userid=35375
View this thread: http://www.excelforum.com/showthread...hreadid=564242



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Refer to combobox in userform with variable lif Excel Programming 8 June 25th 06 11:21 AM
refer to same cell in other worksheet JW Rutgers Excel Programming 2 March 28th 06 10:48 AM
Refer to more than one worksheet in a workbook Göran M Excel Worksheet Functions 0 January 2nd 06 07:02 AM
refer to a userform in a formula TimT Excel Programming 7 July 9th 05 12:05 AM
Formula to refer to other worksheet... Liz-In-USA Excel Worksheet Functions 4 November 9th 04 10:51 PM


All times are GMT +1. The time now is 10:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"