ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   show date only if information entered in cell (https://www.excelbanter.com/excel-worksheet-functions/206789-show-date-only-if-information-entered-cell.html)

digitalmuse

show date only if information entered in cell
 
I want to have the current date show up in the first row say A whenever
someone enters information in a row - in other words if there is data in
cell C4 then the current date should show up in row A4

Mike H

show date only if information entered in cell
 
Hi,

Right click your sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Target.Column = 3 Then
If Target.Value < "" Then
Target.Offset(, -2).Value = Date
Else
Target.Offset(, -2).Value = ""
End If
End If
End Sub

Mike

"digitalmuse" wrote:

I want to have the current date show up in the first row say A whenever
someone enters information in a row - in other words if there is data in
cell C4 then the current date should show up in row A4


Pete_UK

show date only if information entered in cell
 
Put this in A4:

=IF(C4="","",TODAY())

Format the cell as date.

Hope this helps.

Pete

On Oct 17, 2:26*pm, digitalmuse
wrote:
I want to have the current date show up in the first row say A whenever
someone enters information in a row - *in other words if there is data in
cell C4 then the current date should show up in row A4



Ashish Mathur[_2_]

show date only if information entered in cell
 
Hi,

you could try the following formula in cell A4:

=if(C4<"",today(),"")

--
Regards,

Ashsih Mathur
Microsoft Excel MVP
www.ashishmathur.com

"digitalmuse" wrote in message
...
I want to have the current date show up in the first row say A whenever
someone enters information in a row - in other words if there is data in
cell C4 then the current date should show up in row A4



digitalmuse

show date only if information entered in cell
 
Thank you so much works like a charm

"Mike H" wrote:

Hi,

Right click your sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Target.Column = 3 Then
If Target.Value < "" Then
Target.Offset(, -2).Value = Date
Else
Target.Offset(, -2).Value = ""
End If
End If
End Sub

Mike

"digitalmuse" wrote:

I want to have the current date show up in the first row say A whenever
someone enters information in a row - in other words if there is data in
cell C4 then the current date should show up in row A4


digitalmuse

show date only if information entered in cell
 
thanks for the responses and i guess i should have been clearer, the formula
cant depend on input to cell c4 only it needs to apply to any entry made in
column C



"Ashish Mathur" wrote:

Hi,

you could try the following formula in cell A4:

=if(C4<"",today(),"")

--
Regards,

Ashsih Mathur
Microsoft Excel MVP
www.ashishmathur.com

"digitalmuse" wrote in message
...
I want to have the current date show up in the first row say A whenever
someone enters information in a row - in other words if there is data in
cell C4 then the current date should show up in row A4



digitalmuse

show date only if information entered in cell
 
which i believe is why the formula now is not working it worked up until row 3
now anything entered in column c after row 3 does not result in a date entry
in colum a

"Mike H" wrote:

Hi,

Right click your sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Target.Column = 3 Then
If Target.Value < "" Then
Target.Offset(, -2).Value = Date
Else
Target.Offset(, -2).Value = ""
End If
End If
End Sub

Mike

"digitalmuse" wrote:

I want to have the current date show up in the first row say A whenever
someone enters information in a row - in other words if there is data in
cell C4 then the current date should show up in row A4


Pete_UK

show date only if information entered in cell
 
Try it this way, then:

=IF(COUNTA(C:C)0,TODAY(),"")

Hope this helps.

Pete

On Oct 17, 3:39*pm, digitalmuse
wrote:
thanks for the responses and i guess i should have been clearer, *the formula
cant depend on input to cell c4 only it needs to apply to any entry made in
column C


Mike H

show date only if information entered in cell
 
Hi,

It's written to only work on column C (3)

If Target.Column = 3 Then

If you want to work on a different column change the 3 and the offset to 1
less than the column number. IF you want it to work on a number of columns
then that's a slight re-write

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("A:F")) Is Nothing Then
Application.EnableEvents = False
If Target.Value < "" Then
Cells(Target.Row, 1).Value = Date
Else
Cells(Target.Row, 1).Value = ""
End If
Application.EnableEvents = True
End If
End Sub

Mike

"digitalmuse" wrote:

which i believe is why the formula now is not working it worked up until row 3
now anything entered in column c after row 3 does not result in a date entry
in colum a

"Mike H" wrote:

Hi,

Right click your sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Target.Column = 3 Then
If Target.Value < "" Then
Target.Offset(, -2).Value = Date
Else
Target.Offset(, -2).Value = ""
End If
End If
End Sub

Mike

"digitalmuse" wrote:

I want to have the current date show up in the first row say A whenever
someone enters information in a row - in other words if there is data in
cell C4 then the current date should show up in row A4


digitalmuse

show date only if information entered in cell
 
It does work in a cell - im trying now to get it to work in all the cells in
that column(range)

thanks for the assist !

"Pete_UK" wrote:

Try it this way, then:

=IF(COUNTA(C:C)0,TODAY(),"")

Hope this helps.

Pete

On Oct 17, 3:39 pm, digitalmuse
wrote:
thanks for the responses and i guess i should have been clearer, the formula
cant depend on input to cell c4 only it needs to apply to any entry made in
column C



ShaneDevenshire

show date only if information entered in cell
 
Hi,

Try something like this:

=IF(COUNTA(B1:IV1)0,TODAY(),"")


--
Thanks,
Shane Devenshire


"digitalmuse" wrote:

I want to have the current date show up in the first row say A whenever
someone enters information in a row - in other words if there is data in
cell C4 then the current date should show up in row A4


digitalmuse

show date only if information entered in cell
 
that works perfect in one cell what would i add or modify to have it apply to
an entire colum(or named range) i.e. range is named entryDate and covers
column A


"Pete_UK" wrote:

Put this in A4:

=IF(C4="","",TODAY())

Format the cell as date.

Hope this helps.

Pete

On Oct 17, 2:26 pm, digitalmuse
wrote:
I want to have the current date show up in the first row say A whenever
someone enters information in a row - in other words if there is data in
cell C4 then the current date should show up in row A4




Gord Dibben

show date only if information entered in cell
 
Do you realize that the TODAY() function is volatile and will change when
you open the workbook tomorrow?

I would go with Mike's event code to add a static date in column A whenever
a cell in Column C is changed.


Gord Dibben MS Excel MVP

On Fri, 17 Oct 2008 08:53:01 -0700, digitalmuse
wrote:

It does work in a cell - im trying now to get it to work in all the cells in
that column(range)

thanks for the assist !

"Pete_UK" wrote:

Try it this way, then:

=IF(COUNTA(C:C)0,TODAY(),"")

Hope this helps.

Pete

On Oct 17, 3:39 pm, digitalmuse
wrote:
thanks for the responses and i guess i should have been clearer, the formula
cant depend on input to cell c4 only it needs to apply to any entry made in
column C





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com