Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Initiate a form on the selection of a particular cell of a workshe

Hi,
I have made a form with a calendar and want to show the form when cell
"D3" is selected on a particular worksheet. Is there a straight forward way
to do this?

--
Thanks

Stephane
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Initiate a form on the selection of a particular cell of a workshe

Option Explicit

Private Sub Worksheet_SeelectionChange(ByVal Target As Range)
Const WS_RANGE As String = "D3"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
frmCalendar.Show
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.




--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Stephane P" wrote in message
...
Hi,
I have made a form with a calendar and want to show the form when cell
"D3" is selected on a particular worksheet. Is there a straight forward

way
to do this?

--
Thanks

Stephane



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Initiate a form on the selection of a particular cell of a workshe

With Target <<<<<<<<
frmCalendar.Show
End With <<<<<<<<

Bob,
Why are these lines necessary (<<<<<<);
To E-x-p-a-n-d my understanding.


"Bob Phillips" wrote in message
...
Option Explicit

Private Sub Worksheet_SeelectionChange(ByVal Target As Range)
Const WS_RANGE As String = "D3"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
frmCalendar.Show
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.




--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Stephane P" wrote in message
...
Hi,
I have made a form with a calendar and want to show the form when cell
"D3" is selected on a particular worksheet. Is there a straight forward

way
to do this?

--
Thanks

Stephane





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default Initiate a form on the selection of a particular cell of a workshe

Stephane:

make Worksheet_SelectionChange


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address(0, 0) = "D3" Then
CaForm_Initialize
End If
End Sub

file download:
http://vba.holyou.net/file/9412121.xls

--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"Stephane P" wrote:

Hi,
I have made a form with a calendar and want to show the form when cell
"D3" is selected on a particular worksheet. Is there a straight forward way
to do this?

--
Thanks

Stephane

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Initiate a form on the selection of a particular cell of a wor

It worked a treat. I thought there must be a simple way!
--
Thanks for your help

Stephane


"chijanzen" wrote:

Stephane:

make Worksheet_SelectionChange


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address(0, 0) = "D3" Then
CaForm_Initialize
End If
End Sub

file download:
http://vba.holyou.net/file/9412121.xls

--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"Stephane P" wrote:

Hi,
I have made a form with a calendar and want to show the form when cell
"D3" is selected on a particular worksheet. Is there a straight forward way
to do this?

--
Thanks

Stephane



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Initiate a form on the selection of a particular cell of a workshe

Jim,

They are not. I just amended a template event procedures, and didn't remove
them.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"JMay" wrote in message
news:IEenf.65857$_k3.34503@dukeread01...
With Target <<<<<<<<
frmCalendar.Show
End With <<<<<<<<

Bob,
Why are these lines necessary (<<<<<<);
To E-x-p-a-n-d my understanding.


"Bob Phillips" wrote in message
...
Option Explicit

Private Sub Worksheet_SeelectionChange(ByVal Target As Range)
Const WS_RANGE As String = "D3"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
frmCalendar.Show
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.




--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Stephane P" wrote in message
...
Hi,
I have made a form with a calendar and want to show the form when

cell
"D3" is selected on a particular worksheet. Is there a straight forward

way
to do this?

--
Thanks

Stephane







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
How 2 change date in 1 cell/worksheet so it changes in all workshe Mjd0985 Excel Discussion (Misc queries) 2 February 17th 10 05:28 PM
How do I populate a cell with data from a cell in another workshe. holtzy24 Excel Discussion (Misc queries) 1 March 11th 08 11:22 PM
How do I fill a cell in a user form from a selection on same form? Terry Tipsy Excel Discussion (Misc queries) 4 June 11th 07 02:59 PM
How to addthe last cell in the last column across multiple workshe djc Excel Worksheet Functions 0 April 26th 06 05:48 PM
Data Entry Form : Cell selection P.Jaimal Excel Programming 0 November 26th 05 06:03 PM


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