Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Excel 2003 - Showing Userform

Hi

Is it possible to have a userform display (show) on selection of a specific
cell?

I have come up with the code as below but it shows the form on everytime I
select any cell and not just "B18".


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

' Want userform to display on selection of cell B18.
' If any other cell is selected - nothing.

If Range("b18") = ActiveCell Then Call Furn Else ' "Furn" is UsrFrm.show
If Range("b18") < ActiveCell Then Exit Sub


End Sub

Thanks for your help.

Steve


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Excel 2003 - Showing Userform

Hi Steve,

Something like this should work:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(Target, Range("B18")) _
Is Nothing Then Furn
End Sub

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Steve Jones wrote:
Hi

Is it possible to have a userform display (show) on selection of a
specific cell?

I have come up with the code as below but it shows the form on
everytime I select any cell and not just "B18".


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

' Want userform to display on selection of cell B18.
' If any other cell is selected - nothing.

If Range("b18") = ActiveCell Then Call Furn Else ' "Furn" is
UsrFrm.show If Range("b18") < ActiveCell Then Exit Sub


End Sub

Thanks for your help.

Steve

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Excel 2003 - Showing Userform

Thanks for your incredibly quick response, it works perfectly and I'd been
looking through books and sites for ages.

Cheers

Steve
"Jake Marx" wrote in message
...
Hi Steve,

Something like this should work:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(Target, Range("B18")) _
Is Nothing Then Furn
End Sub

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Steve Jones wrote:
Hi

Is it possible to have a userform display (show) on selection of a
specific cell?

I have come up with the code as below but it shows the form on
everytime I select any cell and not just "B18".


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

' Want userform to display on selection of cell B18.
' If any other cell is selected - nothing.

If Range("b18") = ActiveCell Then Call Furn Else ' "Furn" is
UsrFrm.show If Range("b18") < ActiveCell Then Exit Sub


End Sub

Thanks for your help.

Steve



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Excel 2003 - Showing Userform

Steve Jones wrote:
Thanks for your incredibly quick response, it works perfectly and I'd
been looking through books and sites for ages.


No problem, Steve - glad to help!

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Excel 2003 - Showing Userform

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Address = "$B $18" then
Call Furn
End If

End Sub

--
HTH

-------

Bob Phillips
"Steve Jones" wrote in message
...
Hi

Is it possible to have a userform display (show) on selection of a

specific
cell?

I have come up with the code as below but it shows the form on everytime I
select any cell and not just "B18".


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

' Want userform to display on selection of cell B18.
' If any other cell is selected - nothing.

If Range("b18") = ActiveCell Then Call Furn Else ' "Furn" is

UsrFrm.show
If Range("b18") < ActiveCell Then Exit Sub


End Sub

Thanks for your help.

Steve






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Excel 2003 - Showing Userform

Thanks for your incredibly quick response - I tried the code from Jake and
it worked fine.

I tried yours and DonB's with no success at all, I guess its me!

Once again many thanks
"Bob Phillips" wrote in message
...
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Address = "$B $18" then
Call Furn
End If

End Sub

--
HTH

-------

Bob Phillips
"Steve Jones" wrote in message
...
Hi

Is it possible to have a userform display (show) on selection of a

specific
cell?

I have come up with the code as below but it shows the form on everytime

I
select any cell and not just "B18".


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

' Want userform to display on selection of cell B18.
' If any other cell is selected - nothing.

If Range("b18") = ActiveCell Then Call Furn Else ' "Furn" is

UsrFrm.show
If Range("b18") < ActiveCell Then Exit Sub


End Sub

Thanks for your help.

Steve






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Excel 2003 - Showing Userform

I added a space in the $B$18, that is why mine didn't work, but I can't see
why Don's didn't.

--
HTH

-------

Bob Phillips
"Steve Jones" wrote in message
...
Thanks for your incredibly quick response - I tried the code from Jake and
it worked fine.

I tried yours and DonB's with no success at all, I guess its me!

Once again many thanks
"Bob Phillips" wrote in message
...
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Address = "$B $18" then
Call Furn
End If

End Sub

--
HTH

-------

Bob Phillips
"Steve Jones" wrote in message
...
Hi

Is it possible to have a userform display (show) on selection of a

specific
cell?

I have come up with the code as below but it shows the form on

everytime
I
select any cell and not just "B18".


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

' Want userform to display on selection of cell B18.
' If any other cell is selected - nothing.

If Range("b18") = ActiveCell Then Call Furn Else ' "Furn" is

UsrFrm.show
If Range("b18") < ActiveCell Then Exit Sub


End Sub

Thanks for your help.

Steve








  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Excel 2003 - Showing Userform

Try this:

If Target.Address = "$B$18" then Call Furn Else Exit Sub

Assuming you are running this inside of
Worksheet_SelectionChange
DonB
-----Original Message-----
Hi

Is it possible to have a userform display (show) on

selection of a specific
cell?

I have come up with the code as below but it shows the

form on everytime I
select any cell and not just "B18".


Private Sub Worksheet_SelectionChange(ByVal Target As

Range)

' Want userform to display on selection of cell B18.
' If any other cell is selected - nothing.

If Range("b18") = ActiveCell Then Call Furn

Else ' "Furn" is UsrFrm.show
If Range("b18") < ActiveCell Then Exit Sub


End Sub

Thanks for your help.

Steve


.

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Excel 2003 - Showing Userform

Thanks for your answers. I opted for the answer from Jake which worked fine,
I tried the other two answers and for whatever reason I couldn't get either
to work.

Following on from calling the userform, the user then presses a print button
and that runs through a sequence however it keeps "halting" as it keeps
calling the userform.

If I run the userform from a button and then press the print button
everything works as it should.

Where am I going wrong?
"DonB" wrote in message
...
Try this:

If Target.Address = "$B$18" then Call Furn Else Exit Sub

Assuming you are running this inside of
Worksheet_SelectionChange
DonB
-----Original Message-----
Hi

Is it possible to have a userform display (show) on

selection of a specific
cell?

I have come up with the code as below but it shows the

form on everytime I
select any cell and not just "B18".


Private Sub Worksheet_SelectionChange(ByVal Target As

Range)

' Want userform to display on selection of cell B18.
' If any other cell is selected - nothing.

If Range("b18") = ActiveCell Then Call Furn

Else ' "Furn" is UsrFrm.show
If Range("b18") < ActiveCell Then Exit Sub


End Sub

Thanks for your help.

Steve


.



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
Excel 2003 - a "bar" is not showing Hoib New Users to Excel 2 July 22nd 05 11:55 AM
Excel VBA question - showing userform when opening workbook ajliaks Excel Programming 2 April 12th 04 06:24 PM
Showing Worksheet Range in Userform RonMcC[_2_] Excel Programming 0 February 23rd 04 03:46 PM
Showing a userform based on a condition. Pete Excel Programming 1 January 26th 04 05:34 PM
REPOST: showing a userform boris Excel Programming 2 August 6th 03 02:30 AM


All times are GMT +1. The time now is 11:17 PM.

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"