#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 275
Default display userform

Hi
I have created a very simple userform which I want to be displayed each time
any cell is used. I have tried typing this code..

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
Roulette.Show

Application.EnableEvents = True
End Sub

in the worksheet code module, but when I hit the enter key after adding some
data into any cell the user form doesn't show

any ideas why??

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default display userform

The same thing happened to me this morning. The Worksheet_Change functtion
doesn't reference Target, thereofre it doesn't get called. try adding to the
routine
msgbox(Target). I bet this will work.

"Anthony" wrote:

Hi
I have created a very simple userform which I want to be displayed each time
any cell is used. I have tried typing this code..

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
Roulette.Show

Application.EnableEvents = True
End Sub

in the worksheet code module, but when I hit the enter key after adding some
data into any cell the user form doesn't show

any ideas why??

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 275
Default display userform

Sorry Joel I am new to user forms
where do I place
msgbox(Target).
into my code

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
Roulette.Show
Application.EnableEvents = True
End Sub

thanks
"Joel" wrote:

The same thing happened to me this morning. The Worksheet_Change functtion
doesn't reference Target, thereofre it doesn't get called. try adding to the
routine
msgbox(Target). I bet this will work.

"Anthony" wrote:

Hi
I have created a very simple userform which I want to be displayed each time
any cell is used. I have tried typing this code..

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
Roulette.Show

Application.EnableEvents = True
End Sub

in the worksheet code module, but when I hit the enter key after adding some
data into any cell the user form doesn't show

any ideas why??

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default display userform

I thiink the problem is the code is in the wrong place. In VBA go to the
View Menu and select Project explorer if it iis not opened.

Select the workbook you are using. The worksheet change should be in the
Worksheett where you are making the change. Not in any Module.

Copy the worksheet_Change function. Then go to the worksheet in excel. On
the tab on the bottom of the worksheet (for example sheet1) right click the
tab and slect code. This should open the correct module in VBA were you need
to place the code. Paste the code on this sheet in VBA.

This is just to verify the problem


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
msgbox(Target)
Application.EnableEvents = False
Roulette.Show
Application.EnableEvents = True
End Sub

The same thing happened to me this morning. The Worksheet_Change functtion
doesn't reference Target, thereofre it doesn't get called. try adding to the
routine
msgbox(Target). I bet this will work.

"Anthony" wrote:

Hi
I have created a very simple userform which I want to be displayed each time
any cell is used. I have tried typing this code..

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
Roulette.Show

Application.EnableEvents = True
End Sub

in the worksheet code module, but when I hit the enter key after adding some
data into any cell the user form doesn't show

any ideas why??

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
display status bar value in excel userform? Al B Excel Discussion (Misc queries) 0 November 15th 06 01:21 PM
Userform Jeff Excel Discussion (Misc queries) 1 April 25th 06 07:30 PM
UserForm grahammal Excel Discussion (Misc queries) 15 April 10th 06 06:01 PM
userform carwincarber New Users to Excel 0 October 23rd 05 06:59 PM
How can I create and display a chart dynamically on a UserForm wi. cc Charts and Charting in Excel 1 February 14th 05 02:44 PM


All times are GMT +1. The time now is 11:46 AM.

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

About Us

"It's about Microsoft Excel"