Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Excel formula

Hello,

I'm trying to create a formula in a spreadsheet for the
date. This is to monitor the shares in the market.

How do I make the date field automatically appear on the
cell a value is entered in that row.

For example: if lets say tomorrow when I enter the
selling price in a column, the date should automatically
appear folowwing the system's current date.

I tried typing =today() in the date cell, the next day
when I auto fill the cell formula to next cell below, the
date above changes again to the current date.

Please help.

Thanks,
Sheela
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Excel formula

Hello Sheela
One way would be to use the worksheet_change event and place today's date in
the adjacent column
Now note that with this option, any change made to actual values will also
change the adjacent column's date, this means that if you enter a value
today the adjacent column will bear today's date, if tomorrow you change
this value, then the adjacent column will bear tomorrow's date.
here's some sample code to achieve what you want (values input in column A:
date comes in column B)
(right-click on your sheet tab, choose View code and paste this below)
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Target.Offset(0, 1).Value = Date
End If
End Sub

HTH
Regards
Pascal

"Sheela" a écrit dans le message de
...
Hello,

I'm trying to create a formula in a spreadsheet for the
date. This is to monitor the shares in the market.

How do I make the date field automatically appear on the
cell a value is entered in that row.

For example: if lets say tomorrow when I enter the
selling price in a column, the date should automatically
appear folowwing the system's current date.

I tried typing =today() in the date cell, the next day
when I auto fill the cell formula to next cell below, the
date above changes again to the current date.

Please help.

Thanks,
Sheela



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Excel formula

Hello,

I have pasted the code in the VB Editor. Now, how do I
incorporate this code to the cell?

Thanks.

-----Original Message-----
Hello Sheela
One way would be to use the worksheet_change event and

place today's date in
the adjacent column
Now note that with this option, any change made to

actual values will also
change the adjacent column's date, this means that if

you enter a value
today the adjacent column will bear today's date, if

tomorrow you change
this value, then the adjacent column will bear

tomorrow's date.
here's some sample code to achieve what you want (values

input in column A:
date comes in column B)
(right-click on your sheet tab, choose View code and

paste this below)
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Target.Offset(0, 1).Value = Date
End If
End Sub

HTH
Regards
Pascal

"Sheela" a écrit dans le message de
...
Hello,

I'm trying to create a formula in a spreadsheet for the
date. This is to monitor the shares in the market.

How do I make the date field automatically appear on

the
cell a value is entered in that row.

For example: if lets say tomorrow when I enter the
selling price in a column, the date should

automatically
appear folowwing the system's current date.

I tried typing =today() in the date cell, the next day
when I auto fill the cell formula to next cell below,

the
date above changes again to the current date.

Please help.

Thanks,
Sheela



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Excel formula

Hello again,

I missed out to say something.

My date will be placed in column A and column L. So,
where must I make the changes in the code?

Thanks,
Sheela

-----Original Message-----
Hello Sheela
One way would be to use the worksheet_change event and

place today's date in
the adjacent column
Now note that with this option, any change made to

actual values will also
change the adjacent column's date, this means that if

you enter a value
today the adjacent column will bear today's date, if

tomorrow you change
this value, then the adjacent column will bear

tomorrow's date.
here's some sample code to achieve what you want (values

input in column A:
date comes in column B)
(right-click on your sheet tab, choose View code and

paste this below)
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Target.Offset(0, 1).Value = Date
End If
End Sub

HTH
Regards
Pascal

"Sheela" a écrit dans le message de
...
Hello,

I'm trying to create a formula in a spreadsheet for the
date. This is to monitor the shares in the market.

How do I make the date field automatically appear on

the
cell a value is entered in that row.

For example: if lets say tomorrow when I enter the
selling price in a column, the date should

automatically
appear folowwing the system's current date.

I tried typing =today() in the date cell, the next day
when I auto fill the cell formula to next cell below,

the
date above changes again to the current date.

Please help.

Thanks,
Sheela



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Excel formula

Hello Sheela
You did not either mention where you enter your selling price.
The code I posted triggers values entered into column A with:
If Not Intersect(Target, Range("A:A")) Is Nothing Then <

and then puts dates into the next column on the right (ie column B) with:
Target.Offset(0, 1).Value = Date <

Now you can adpat this to your needs by changing Range("A:A") with the
relevant column
and use Cells(Target.row,"ColumnLetter").Value instead of
Target.Offset(0,1).Value
For example if the column you enter values is column C, and you wish to
place dates into column A and column L:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C:C")) Is Nothing Then
Cells(Target.Row,"A").Value = Date
Cells(Target.Row,"L").Value = Date
End If
End Sub

Hope this helps
Regards
Pascal

"Sheela" a écrit dans le message de
...
Hello again,

I missed out to say something.

My date will be placed in column A and column L. So,
where must I make the changes in the code?

Thanks,
Sheela

-----Original Message-----
Hello Sheela
One way would be to use the worksheet_change event and

place today's date in
the adjacent column
Now note that with this option, any change made to

actual values will also
change the adjacent column's date, this means that if

you enter a value
today the adjacent column will bear today's date, if

tomorrow you change
this value, then the adjacent column will bear

tomorrow's date.
here's some sample code to achieve what you want (values

input in column A:
date comes in column B)
(right-click on your sheet tab, choose View code and

paste this below)
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Target.Offset(0, 1).Value = Date
End If
End Sub

HTH
Regards
Pascal

"Sheela" a écrit dans le message de
...
Hello,

I'm trying to create a formula in a spreadsheet for the
date. This is to monitor the shares in the market.

How do I make the date field automatically appear on

the
cell a value is entered in that row.

For example: if lets say tomorrow when I enter the
selling price in a column, the date should

automatically
appear folowwing the system's current date.

I tried typing =today() in the date cell, the next day
when I auto fill the cell formula to next cell below,

the
date above changes again to the current date.

Please help.

Thanks,
Sheela



.



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
When I enter a formula, Excel shows the formula not the results Pat Adams Excel Worksheet Functions 5 April 4th 23 11:18 AM
Excel 2002 Formula: Urgent Conditional Formula Required Right Away - if possible blue[_2_] Excel Discussion (Misc queries) 2 July 11th 07 06:08 PM
Build excel formula using field values as text in the formula val kilbane Excel Worksheet Functions 2 April 18th 07 01:52 PM
Excel 2002 formula displayed not value formula option not checked Dean Excel Worksheet Functions 1 February 28th 06 02:31 PM
How do I view formula results intead of formula in excel? davidinatlanta Excel Worksheet Functions 4 February 7th 06 03:02 PM


All times are GMT +1. The time now is 11:00 PM.

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"