PC Review


Reply
Thread Tools Rate Thread

Adding Date to another Cell

 
 
anon1m0us
Guest
Posts: n/a
 
      16th Apr 2007
Hi;
I have an excel spreadsheet that if you click Anywhere in Column A it
will bring up a Calendar wheree you need to enter a date. I need the
Current date inputed in Column A and the New Date that you selected in
the calendar to be in Column B. Can someone please help me!

Below is my code.


Dim dDate As Date
Dim LRange As String

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

Private Sub CommandButton2_Click()
UpdateCell
End Sub


Private Sub UserForm_Activate()
Me.Calendar1.Value = Date
End Sub


Private Sub CommandButton1_Click()
Calendar1 = Date
SpinButton1 = 0

End Sub

Private Sub SpinButton1_Change()
If SpinButton1 >= -1 And SpinButton1 <= 1 Then dDate = Calendar1

TextBox1 = SpinButton1
Calendar1 = DateAdd("m", TextBox1.Value, dDate)
UpdateCell
End Sub



Private Sub UpdateCell()
ActiveCell = Calendar1
ActiveCell.NumberFormat = "mm/dd/yyyy"

End Sub

 
Reply With Quote
 
 
 
 
anon1m0us
Guest
Posts: n/a
 
      16th Apr 2007
I want to clarify. That if a user click on Cell A5, the calendar pops
up and the person increases the date, max to 6 months and the result
should be A5 is current date of input and B5 is the new date. Same for
C6..to c100. The new dates need to be in the B range of the active
cell.
anon1m0us wrote:
> Hi;
> I have an excel spreadsheet that if you click Anywhere in Column A it
> will bring up a Calendar wheree you need to enter a date. I need the
> Current date inputed in Column A and the New Date that you selected in
> the calendar to be in Column B. Can someone please help me!
>
> Below is my code.
>
>
> Dim dDate As Date
> Dim LRange As String
>
> Private Sub Calendar1_Click()
> ActiveCell = Calendar1.Value
> End Sub
>
> Private Sub CommandButton2_Click()
> UpdateCell
> End Sub
>
>
> Private Sub UserForm_Activate()
> Me.Calendar1.Value = Date
> End Sub
>
>
> Private Sub CommandButton1_Click()
> Calendar1 = Date
> SpinButton1 = 0
>
> End Sub
>
> Private Sub SpinButton1_Change()
> If SpinButton1 >= -1 And SpinButton1 <= 1 Then dDate = Calendar1
>
> TextBox1 = SpinButton1
> Calendar1 = DateAdd("m", TextBox1.Value, dDate)
> UpdateCell
> End Sub
>
>
>
> Private Sub UpdateCell()
> ActiveCell = Calendar1
> ActiveCell.NumberFormat = "mm/dd/yyyy"
>
> End Sub


 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      16th Apr 2007
cells(activecell.row,2) = Calendar1.Value
cells(activecell.row,1) = Date

--
Regards,
Tom Ogilvy


"anon1m0us" wrote:

> I want to clarify. That if a user click on Cell A5, the calendar pops
> up and the person increases the date, max to 6 months and the result
> should be A5 is current date of input and B5 is the new date. Same for
> C6..to c100. The new dates need to be in the B range of the active
> cell.
> anon1m0us wrote:
> > Hi;
> > I have an excel spreadsheet that if you click Anywhere in Column A it
> > will bring up a Calendar wheree you need to enter a date. I need the
> > Current date inputed in Column A and the New Date that you selected in
> > the calendar to be in Column B. Can someone please help me!
> >
> > Below is my code.
> >
> >
> > Dim dDate As Date
> > Dim LRange As String
> >
> > Private Sub Calendar1_Click()
> > ActiveCell = Calendar1.Value
> > End Sub
> >
> > Private Sub CommandButton2_Click()
> > UpdateCell
> > End Sub
> >
> >
> > Private Sub UserForm_Activate()
> > Me.Calendar1.Value = Date
> > End Sub
> >
> >
> > Private Sub CommandButton1_Click()
> > Calendar1 = Date
> > SpinButton1 = 0
> >
> > End Sub
> >
> > Private Sub SpinButton1_Change()
> > If SpinButton1 >= -1 And SpinButton1 <= 1 Then dDate = Calendar1
> >
> > TextBox1 = SpinButton1
> > Calendar1 = DateAdd("m", TextBox1.Value, dDate)
> > UpdateCell
> > End Sub
> >
> >
> >
> > Private Sub UpdateCell()
> > ActiveCell = Calendar1
> > ActiveCell.NumberFormat = "mm/dd/yyyy"
> >
> > End Sub

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding days from one cell with a date in it to another cell cufc1210 Microsoft Excel Misc 3 20th Aug 2009 12:40 PM
Adding days to a date cell to get a new date Pete Derkowski Microsoft Excel Worksheet Functions 6 1st May 2008 03:53 PM
Adding the date when another cell is set to Bet. Steve Cohen Microsoft Excel Discussion 4 29th Sep 2003 08:21 AM
Adding the date when another cell is set to Bet. Steve Cohen Microsoft Excel Misc 4 29th Sep 2003 08:21 AM
Adding a date to a cell CBG Microsoft Excel Programming 3 21st Sep 2003 03:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:52 AM.