Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
lillywhite
 
Posts: n/a
Default have a date cell pop up a monthly calendar to choose a date

Can I create a date cell that will pop up a monthly calendar from which I can
choose a date, and which will allow me to scroll forward or back through the
months of the year and even into future years.
  #2   Report Post  
venspen
 
Posts: n/a
Default



"lillywhite" wrote:

Can I create a date cell that will pop up a monthly calendar from which I can
choose a date, and which will allow me to scroll forward or back through the
months of the year and even into future years.


Put a monthview control on your worksheet near the cell you want to enter
the date into. Set it's visible property to false.

In this case when the user enters cell A6 the monthview will become visible.
When the user double clicks on the date they want A6 will now have that date
and the monthview will hide itself.

In the sheets code window paste the following code:

Private Sub MonthView1_DblClick()
With MonthView1
ActiveCell.Value = .Value
.Visible = False
End With
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim rng As Range
Set rng = Application.Intersect(Target, Range("B6"))
With MonthView1
If Not rng Is Nothing Then
.Visible = True
.Top = Target.Top
.Left = Target.Left
Else
.Visible = False
End If
End With
End Sub
  #3   Report Post  
Rob
 
Posts: n/a
Default

Hi,

I'd also like to do what lillywhite asked but can't figure out where the
monthview object comes from - can you perhaps give me some pointers.
Thanks, Rob
"venspen" wrote in message
...


"lillywhite" wrote:

Can I create a date cell that will pop up a monthly calendar from which I
can
choose a date, and which will allow me to scroll forward or back through
the
months of the year and even into future years.


Put a monthview control on your worksheet near the cell you want to enter
the date into. Set it's visible property to false.

In this case when the user enters cell A6 the monthview will become
visible.
When the user double clicks on the date they want A6 will now have that
date
and the monthview will hide itself.

In the sheets code window paste the following code:

Private Sub MonthView1_DblClick()
With MonthView1
ActiveCell.Value = .Value
.Visible = False
End With
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim rng As Range
Set rng = Application.Intersect(Target, Range("B6"))
With MonthView1
If Not rng Is Nothing Then
.Visible = True
.Top = Target.Top
.Left = Target.Left
Else
.Visible = False
End If
End With
End Sub



  #4   Report Post  
venspen
 
Posts: n/a
Default



"Rob" wrote:

Hi,

I'd also like to do what lillywhite asked but can't figure out where the
monthview object comes from - can you perhaps give me some pointers.
Thanks, Rob
"venspen" wrote in message
...


"lillywhite" wrote:

Can I create a date cell that will pop up a monthly calendar from which I
can
choose a date, and which will allow me to scroll forward or back through
the
months of the year and even into future years.


Put a monthview control on your worksheet near the cell you want to enter
the date into. Set it's visible property to false.

In this case when the user enters cell A6 the monthview will become
visible.
When the user double clicks on the date they want A6 will now have that
date
and the monthview will hide itself.

In the sheets code window paste the following code:

Private Sub MonthView1_DblClick()
With MonthView1
ActiveCell.Value = .Value
.Visible = False
End With
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim rng As Range
Set rng = Application.Intersect(Target, Range("B6"))
With MonthView1
If Not rng Is Nothing Then
.Visible = True
.Top = Target.Top
.Left = Target.Left
Else
.Visible = False
End If
End With
End Sub





Sorry about that, my bad! I think that Monthview is a control that is
installed with Visual Basic 6. You can use the Calendar Control in the same
fashion:

Private Sub Calendar1_DblClick()
With Calendar1
ActiveCell.Value = .Value
.Visible = False
End With
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim rng As Range
Set rng = Application.Intersect(Target, Range("B6"))
With Calendar1
If Not rng Is Nothing Then
.Visible = True
.Top = Target.Top
.Left = Target.Left
Else
.Visible = False
End If
End With
End Sub
  #5   Report Post  
Rob
 
Posts: n/a
Default

Thanks, Calendar Control has done it. Appreciate your help.

Rob
"venspen" wrote in message
...


"Rob" wrote:

Hi,

I'd also like to do what lillywhite asked but can't figure out where the
monthview object comes from - can you perhaps give me some pointers.
Thanks, Rob
"venspen" wrote in message
...


"lillywhite" wrote:

Can I create a date cell that will pop up a monthly calendar from
which I
can
choose a date, and which will allow me to scroll forward or back
through
the
months of the year and even into future years.

Put a monthview control on your worksheet near the cell you want to
enter
the date into. Set it's visible property to false.

In this case when the user enters cell A6 the monthview will become
visible.
When the user double clicks on the date they want A6 will now have that
date
and the monthview will hide itself.

In the sheets code window paste the following code:

Private Sub MonthView1_DblClick()
With MonthView1
ActiveCell.Value = .Value
.Visible = False
End With
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim rng As Range
Set rng = Application.Intersect(Target, Range("B6"))
With MonthView1
If Not rng Is Nothing Then
.Visible = True
.Top = Target.Top
.Left = Target.Left
Else
.Visible = False
End If
End With
End Sub





Sorry about that, my bad! I think that Monthview is a control that is
installed with Visual Basic 6. You can use the Calendar Control in the
same
fashion:

Private Sub Calendar1_DblClick()
With Calendar1
ActiveCell.Value = .Value
.Visible = False
End With
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim rng As Range
Set rng = Application.Intersect(Target, Range("B6"))
With Calendar1
If Not rng Is Nothing Then
.Visible = True
.Top = Target.Top
.Left = Target.Left
Else
.Visible = False
End If
End With
End Sub



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
cell color change based on due date MINAL ZUNKE New Users to Excel 2 June 30th 05 09:24 PM
Combined date time cell to separate date & time components Mark Ada Excel Discussion (Misc queries) 1 December 2nd 04 02:48 AM
Combined date time cell to separate date & time components Mark Ada Excel Discussion (Misc queries) 1 December 2nd 04 12:07 AM
Combined date time cell to separate date & time components Mark Ada Excel Discussion (Misc queries) 1 December 2nd 04 12:07 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


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

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"