Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Show A userform on selection range

Hi,

Is it possible to show a userform when the user selects a cell (enters the
cell), I can use the selectionchange but is there a on cell enter
/selection?

Thanks!



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Show A userform on selection range

Hi Sanjay, I am not sure that I understand your distinction between the
Selctionchange event and " on cell enter /selection" , but perhaps your
intention is to limit the event response to a single cell or range.

Try, therefo

'=============
Private Sub Worksheet_SelectionChange _
(ByVal Target As Range)
Dim rng As Range

Set rng = Me.Range("A1") '<<==== CHANGE

If Not Intersect(rng, Target) Is Nothing Then
UserForm1.Show
End If
End Sub
'<<=============

---
Regards,
Norman


"Sanjay" wrote in message
...
Hi,

Is it possible to show a userform when the user selects a cell (enters the
cell), I can use the selectionchange but is there a on cell enter
/selection?

Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Show A userform on selection range

Thanks Norman,

What I'm after if possible is that when the user clicks a cell, the userform
is displayed, but at the moment the only option I can see is if the cell is
changed then the userform can be displayed.

Thanks!



"Norman Jones" wrote in message
...
Hi Sanjay, I am not sure that I understand your distinction between the
Selctionchange event and " on cell enter /selection" , but perhaps your
intention is to limit the event response to a single cell or range.

Try, therefo

'=============
Private Sub Worksheet_SelectionChange _
(ByVal Target As Range)
Dim rng As Range

Set rng = Me.Range("A1") '<<==== CHANGE

If Not Intersect(rng, Target) Is Nothing Then
UserForm1.Show
End If
End Sub
'<<=============

---
Regards,
Norman


"Sanjay" wrote in message
...
Hi,

Is it possible to show a userform when the user selects a cell (enters
the cell), I can use the selectionchange but is there a on cell enter
/selection?

Thanks!






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Show A userform on selection range

Hi Sanjay,

'-----------------
What I'm after if possible is that when the user clicks a cell, the userform
is displayed, but at the moment the only option I can see is if the cell is
changed then the userform can be displayed.
'-----------------

Have you tried the code?

The Worksheet_SelectionChange event responds to a change
in selection; the Worksheet_Change event responds to a (non
formula) value change.


---
Regards,
Norman


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Show A userform on selection range

Norman,

That's what I was after thanks again!

Regards,

Sanj


"Norman Jones" wrote in message
...
Hi Sanjay,

'-----------------
What I'm after if possible is that when the user clicks a cell, the
userform
is displayed, but at the moment the only option I can see is if the cell
is
changed then the userform can be displayed.
'-----------------

Have you tried the code?

The Worksheet_SelectionChange event responds to a change
in selection; the Worksheet_Change event responds to a (non
formula) value change.


---
Regards,
Norman





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
Selection of UserForm through button saziz[_30_] Excel Programming 4 December 13th 05 01:20 AM
FILTER: show/don't show selection with tickboxes ancharwashere Excel Discussion (Misc queries) 2 October 11th 05 09:20 PM
selection all textboxes in userform at once Marthijn Beusekom via OfficeKB.com Excel Programming 2 February 19th 05 01:08 AM
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. jonH Excel Programming 3 June 7th 04 09:13 PM
Date Selection Userform Archie[_2_] Excel Programming 2 April 13th 04 07:05 AM


All times are GMT +1. The time now is 07:45 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"