Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How 2 change date in 1 cell/worksheet so it changes in all workshe | Excel Discussion (Misc queries) | |||
How do I populate a cell with data from a cell in another workshe. | Excel Discussion (Misc queries) | |||
How do I fill a cell in a user form from a selection on same form? | Excel Discussion (Misc queries) | |||
How to addthe last cell in the last column across multiple workshe | Excel Worksheet Functions | |||
Data Entry Form : Cell selection | Excel Programming |