Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default How do I lock a stamp date/time formula for an entry on a row?

I have a spreadsheet that is setup with Stamp Date/Time formula. I want each
row to be independent but every time I add an entry and save it, and move to
the next row and add another entry it changes the Stamp Date/Time formula on
all rows. How do I make it a true Stamp Date/Time spreadsheet so each row is
independent of the other?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default How do I lock a stamp date/time formula for an entry on a row?

Only by using VBA event code in the worksheet.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col A
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
n = Target.Row
If Excel.Range("A" & n).Value < "" Then
Excel.Range("B" & n).Value = Now
End If
End If
enditall:
Application.EnableEvents = True
End Sub

Right-click on the sheet tab and "View Code".

Copy/paste the above into that sheet module.

When you enter data in any cell in column A, a static date/time stamp goes into
column B on same row.


Gord Dibben MS Excel MVP

On Wed, 2 Aug 2006 16:32:01 -0700, PROPERTIES INC. <PROPERTIES
wrote:

I have a spreadsheet that is setup with Stamp Date/Time formula. I want each
row to be independent but every time I add an entry and save it, and move to
the next row and add another entry it changes the Stamp Date/Time formula on
all rows. How do I make it a true Stamp Date/Time spreadsheet so each row is
independent of the other?


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default How do I lock a stamp date/time formula for an entry on a row?

Thanks Gord but I am a newby to Excel. How do I use VBA? I am currently
using Excel 2002. So I am still learning the in's and out's of Excel.


"Gord Dibben" wrote:

Only by using VBA event code in the worksheet.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col A
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
n = Target.Row
If Excel.Range("A" & n).Value < "" Then
Excel.Range("B" & n).Value = Now
End If
End If
enditall:
Application.EnableEvents = True
End Sub

Right-click on the sheet tab and "View Code".

Copy/paste the above into that sheet module.

When you enter data in any cell in column A, a static date/time stamp goes into
column B on same row.


Gord Dibben MS Excel MVP

On Wed, 2 Aug 2006 16:32:01 -0700, PROPERTIES INC. <PROPERTIES
wrote:

I have a spreadsheet that is setup with Stamp Date/Time formula. I want each
row to be independent but every time I add an entry and save it, and move to
the next row and add another entry it changes the Stamp Date/Time formula on
all rows. How do I make it a true Stamp Date/Time spreadsheet so each row is
independent of the other?



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default How do I lock a stamp date/time formula for an entry on a row?

Please read the part about "Right-click on the sheet tab" and onward.

The actual code to paste starts at Private Worksheet and goes to End Sub


Gord

On Thu, 3 Aug 2006 16:23:02 -0700, PROPERTIES INC.
wrote:

Thanks Gord but I am a newby to Excel. How do I use VBA? I am currently
using Excel 2002. So I am still learning the in's and out's of Excel.


"Gord Dibben" wrote:

Only by using VBA event code in the worksheet.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col A
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
n = Target.Row
If Excel.Range("A" & n).Value < "" Then
Excel.Range("B" & n).Value = Now
End If
End If
enditall:
Application.EnableEvents = True
End Sub

Right-click on the sheet tab and "View Code".

Copy/paste the above into that sheet module.

When you enter data in any cell in column A, a static date/time stamp goes into
column B on same row.


Gord Dibben MS Excel MVP

On Wed, 2 Aug 2006 16:32:01 -0700, PROPERTIES INC. <PROPERTIES
wrote:

I have a spreadsheet that is setup with Stamp Date/Time formula. I want each
row to be independent but every time I add an entry and save it, and move to
the next row and add another entry it changes the Stamp Date/Time formula on
all rows. How do I make it a true Stamp Date/Time spreadsheet so each row is
independent of the other?




Gord Dibben MS Excel MVP
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
how do i lock a cell? to save formula or function in it? Ajay Upmaneu Excel Discussion (Misc queries) 1 July 4th 06 10:17 AM
Formula and Data Entry in a Single Cell Josh VM Excel Discussion (Misc queries) 1 October 21st 05 09:31 PM
date/time stamp Jan Excel Worksheet Functions 7 July 14th 05 01:04 PM
lock formula in excel jimdk Excel Discussion (Misc queries) 1 June 16th 05 09:57 PM
Preserve Excel formula entry MHoffmeier Excel Discussion (Misc queries) 5 December 2nd 04 06:34 PM


All times are GMT +1. The time now is 05:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"