Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Use of Calendar in both a form and excel sheet

Steen,
You need some check of where the calendar was called from. Depending how you
calling it, set a global variable at suitable places then check its value to
determine the destination:
Dim FromWS as boolean

.....
If FromWS = True Then
ActiveCell.Value = Calendar1.Value
Else
frmSelectView.ActiveControl = Calendar1.Value
End If

NickHK

"Steen" wrote in message
...
Hi Alok

Thanks for your feedback, but unfurtuanately it does not solve my problem.

If I use the below the dates will be set for both the userform and the
tasklist (deadline) at the same time. I wood like it to be independent -
graph dates has there own dates and Deadlines in the tasklist there own
deadlines.

Can you help me out here?

/Steen

"Alok" wrote:

This works for me

Private Sub Calendar1_Click()
ActiveCell.Value = Calendar1.Value
frmSelectView.ActiveControl = Calendar1.Value
End Sub

Alok

"Steen" wrote:

Hi

I am trying to use the Calendar in both a form selecting start and end

dates
for grapical presentation of data and on a tasklist (excelsheet) all

in the
same wordbook. My problem is that I can't figure out to use it in both

ways -
se my code below:

Private Sub Calendar1_Click()
'frmSelectView.ActiveControl.Value = Calendar1.Value
'frmSelectView.ActiveControl.SetFocus
ActiveCell.Value = Calendar1.Value
'ActiveCell.SetFocus
Unload Me
End Sub

At setup above it works nicely inserting dates in tasklist. If I

uncomment
the other lines and deactivate the current active line - it works

nicely
inserting dates in the userform. How to both?



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Use of Calendar in both a form and excel sheet

Hi NickHK

Thanks for your answer - I havn't had time to try it yet, but will return
with the result during the next week :-)

Where do I declare a global variable - the code is placed in different places?

/Steen

"NickHK" skrev:

Steen,
You need some check of where the calendar was called from. Depending how you
calling it, set a global variable at suitable places then check its value to
determine the destination:
Dim FromWS as boolean

.....
If FromWS = True Then
ActiveCell.Value = Calendar1.Value
Else
frmSelectView.ActiveControl = Calendar1.Value
End If

NickHK

"Steen" wrote in message
...
Hi Alok

Thanks for your feedback, but unfurtuanately it does not solve my problem.

If I use the below the dates will be set for both the userform and the
tasklist (deadline) at the same time. I wood like it to be independent -
graph dates has there own dates and Deadlines in the tasklist there own
deadlines.

Can you help me out here?

/Steen

"Alok" wrote:

This works for me

Private Sub Calendar1_Click()
ActiveCell.Value = Calendar1.Value
frmSelectView.ActiveControl = Calendar1.Value
End Sub

Alok

"Steen" wrote:

Hi

I am trying to use the Calendar in both a form selecting start and end

dates
for grapical presentation of data and on a tasklist (excelsheet) all

in the
same wordbook. My problem is that I can't figure out to use it in both

ways -
se my code below:

Private Sub Calendar1_Click()
'frmSelectView.ActiveControl.Value = Calendar1.Value
'frmSelectView.ActiveControl.SetFocus
ActiveCell.Value = Calendar1.Value
'ActiveCell.SetFocus
Unload Me
End Sub

At setup above it works nicely inserting dates in tasklist. If I

uncomment
the other lines and deactivate the current active line - it works

nicely
inserting dates in the userform. How to both?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Use of Calendar in both a form and excel sheet

Declare it at the top of a General/Standard Module (Insert=Module) above
any procedure

Public FromWs as Boolean

--
Regards,
Tom Ogilvy


"Steen" wrote in message
...
Hi NickHK

Thanks for your answer - I havn't had time to try it yet, but will return
with the result during the next week :-)

Where do I declare a global variable - the code is placed in different
places?

/Steen

"NickHK" skrev:

Steen,
You need some check of where the calendar was called from. Depending how
you
calling it, set a global variable at suitable places then check its value
to
determine the destination:
Dim FromWS as boolean

.....
If FromWS = True Then
ActiveCell.Value = Calendar1.Value
Else
frmSelectView.ActiveControl = Calendar1.Value
End If

NickHK

"Steen" wrote in message
...
Hi Alok

Thanks for your feedback, but unfurtuanately it does not solve my
problem.

If I use the below the dates will be set for both the userform and the
tasklist (deadline) at the same time. I wood like it to be
independent -
graph dates has there own dates and Deadlines in the tasklist there own
deadlines.

Can you help me out here?

/Steen

"Alok" wrote:

This works for me

Private Sub Calendar1_Click()
ActiveCell.Value = Calendar1.Value
frmSelectView.ActiveControl = Calendar1.Value
End Sub

Alok

"Steen" wrote:

Hi

I am trying to use the Calendar in both a form selecting start and
end

dates
for grapical presentation of data and on a tasklist (excelsheet)
all

in the
same wordbook. My problem is that I can't figure out to use it in
both

ways -
se my code below:

Private Sub Calendar1_Click()
'frmSelectView.ActiveControl.Value = Calendar1.Value
'frmSelectView.ActiveControl.SetFocus
ActiveCell.Value = Calendar1.Value
'ActiveCell.SetFocus
Unload Me
End Sub

At setup above it works nicely inserting dates in tasklist. If I

uncomment
the other lines and deactivate the current active line - it works

nicely
inserting dates in the userform. How to both?






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Use of Calendar in both a form and excel sheet

Thanks Tom - it works nicely :-)

"Tom Ogilvy" skrev:

Declare it at the top of a General/Standard Module (Insert=Module) above
any procedure

Public FromWs as Boolean

--
Regards,
Tom Ogilvy


"Steen" wrote in message
...
Hi NickHK

Thanks for your answer - I havn't had time to try it yet, but will return
with the result during the next week :-)

Where do I declare a global variable - the code is placed in different
places?

/Steen

"NickHK" skrev:

Steen,
You need some check of where the calendar was called from. Depending how
you
calling it, set a global variable at suitable places then check its value
to
determine the destination:
Dim FromWS as boolean

.....
If FromWS = True Then
ActiveCell.Value = Calendar1.Value
Else
frmSelectView.ActiveControl = Calendar1.Value
End If

NickHK

"Steen" wrote in message
...
Hi Alok

Thanks for your feedback, but unfurtuanately it does not solve my
problem.

If I use the below the dates will be set for both the userform and the
tasklist (deadline) at the same time. I wood like it to be
independent -
graph dates has there own dates and Deadlines in the tasklist there own
deadlines.

Can you help me out here?

/Steen

"Alok" wrote:

This works for me

Private Sub Calendar1_Click()
ActiveCell.Value = Calendar1.Value
frmSelectView.ActiveControl = Calendar1.Value
End Sub

Alok

"Steen" wrote:

Hi

I am trying to use the Calendar in both a form selecting start and
end
dates
for grapical presentation of data and on a tasklist (excelsheet)
all
in the
same wordbook. My problem is that I can't figure out to use it in
both
ways -
se my code below:

Private Sub Calendar1_Click()
'frmSelectView.ActiveControl.Value = Calendar1.Value
'frmSelectView.ActiveControl.SetFocus
ActiveCell.Value = Calendar1.Value
'ActiveCell.SetFocus
Unload Me
End Sub

At setup above it works nicely inserting dates in tasklist. If I
uncomment
the other lines and deactivate the current active line - it works
nicely
inserting dates in the userform. How to both?






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Use of Calendar in both a form and excel sheet

Thanks NicKHK - it works nicely

"NickHK" skrev:

Steen,
You need some check of where the calendar was called from. Depending how you
calling it, set a global variable at suitable places then check its value to
determine the destination:
Dim FromWS as boolean

.....
If FromWS = True Then
ActiveCell.Value = Calendar1.Value
Else
frmSelectView.ActiveControl = Calendar1.Value
End If

NickHK

"Steen" wrote in message
...
Hi Alok

Thanks for your feedback, but unfurtuanately it does not solve my problem.

If I use the below the dates will be set for both the userform and the
tasklist (deadline) at the same time. I wood like it to be independent -
graph dates has there own dates and Deadlines in the tasklist there own
deadlines.

Can you help me out here?

/Steen

"Alok" wrote:

This works for me

Private Sub Calendar1_Click()
ActiveCell.Value = Calendar1.Value
frmSelectView.ActiveControl = Calendar1.Value
End Sub

Alok

"Steen" wrote:

Hi

I am trying to use the Calendar in both a form selecting start and end

dates
for grapical presentation of data and on a tasklist (excelsheet) all

in the
same wordbook. My problem is that I can't figure out to use it in both

ways -
se my code below:

Private Sub Calendar1_Click()
'frmSelectView.ActiveControl.Value = Calendar1.Value
'frmSelectView.ActiveControl.SetFocus
ActiveCell.Value = Calendar1.Value
'ActiveCell.SetFocus
Unload Me
End Sub

At setup above it works nicely inserting dates in tasklist. If I

uncomment
the other lines and deactivate the current active line - it works

nicely
inserting dates in the userform. How to both?




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
download a template excel Calendar into a work sheet? Carl R[_2_] Excel Discussion (Misc queries) 1 January 26th 10 10:56 PM
How do i insert an interactive calendar in an excel form Maria[_3_] Setting up and Configuration of Excel 2 April 26th 09 01:54 PM
Add a form and put a calendar on it using VBA XP Excel Programming 0 December 4th 06 09:23 PM
Copy form field value to another form (calendar) [email protected] Excel Programming 1 December 1st 05 09:58 PM
put a calendar on an excel sheet M K W Excel Programming 3 August 27th 03 05:34 AM


All times are GMT +1. The time now is 10:43 AM.

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"