LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default <HELPModify calender code for a combo box

I have the following code on a page to pop up a calender when 1 of 2 cells
are selected and then the chosen date fills the active cell and disappears
when a cell outside the range is selected.
My question is - is it possible to modify this code to do the same with a
combo box I have on another page. I have tried substituting references to the
calender object with the combo box name but there are some obvious other
things that need changing and I am a VBA dunce. The code is

Private Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.NumberFormat = "dd/mm/yy"
ActiveCell.Select
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Not Application.Intersect(Range("G14,G17"), Target) Is Nothing Then
Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
' select Today's date in the Calendar
Calendar1.Value = Date
ElseIf Calendar1.Visible Then Calendar1.Visible = False
End If
End Sub

and the current code for the combo box is

Private Sub ComboBox1_Change()

End Sub

Can anyone help
gratitude in vast quantities in advance
 
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
Modify Code Richard Excel Worksheet Functions 0 March 13th 08 08:19 PM
what is the code for calender dates? gabe Excel Discussion (Misc queries) 1 July 4th 06 12:09 PM
modify query with value in combo box [email protected] Excel Programming 2 December 8th 05 11:04 PM
Help me modify this VBA code please: sanmisds1 Excel Programming 4 July 16th 05 04:48 AM
Combo into calender? calculus87[_7_] Excel Programming 9 August 9th 04 04:17 PM


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