Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On May 18, 8:52*am, Greg D <Greg
wrote: We have a spreadsheet that we would like to automatically add the date in the first cell of each row when information is entered into another cell in that row. The date would need to remain static once added. Any suggestions? I don't think there's a function that will work for this, but you could use the following vba: If Range("A" & Target.Row).Value = "" Then Range("A" & Target.Row).Value = Now() End If To assign the code, right-click on the tab and select View Code. The vba editor will open. Click the drop-down list that contains the text "(General)" and select Worksheet. Then click the drop down list in the upper right that contains the text "(Declarations)" and select Change. You should then be presented with this: Private Sub Worksheet_Change(ByVal Target As Range) End Sub Paste the code from above between the two lines of text. It should look like this: Private Sub Worksheet_Change(ByVal Target As Range) If Range("A" & Target.Row).Value = "" Then Range("A" & Target.Row).Value = Now() End If End Sub Close the vba editor window to get back to the spreadsheet. Hope this helps. Jason |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Concatenate including a date so that the date appears as a date | Excel Worksheet Functions | |||
date in Cell to change colors if the date is beyond today's date | Excel Discussion (Misc queries) | |||
Making a date go red, if date passes todays date. | Excel Worksheet Functions | |||
Report Date - Date Recv = Days Late, but how to rid completed date | Excel Worksheet Functions | |||
Date updates from worksheet to chart & changes date to a date series! Help!! | Charts and Charting in Excel |