View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
JLatham JLatham is offline
external usenet poster
 
Posts: 3,365
Default trace order of data entry

Copy the code below and put it into the worksheet's code module. To do that,
right-click on the worksheet's name tab and choose [View Code] from the popup
list that appears. Then copy the code below and paste it into the module.
You can now close the VB Editor (the window that opened with the code module
in it). Save your workbook.

When you type anything into column A, it will appear in column C along with
the row number where you made the entry into column A. That may help you if
you have duplicate names or change an existing entry later. If you [del] a
name in column A, it remains in column C.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim nextRow As Long
If Target.Column < Range("A1").Column Then
Exit Sub ' not a name change
End If
If Not IsEmpty(Target) And Target.Cells.Count = 1 Then
'only works when just 1 cell selected/changed
'keep list of sequence of names entered in column C
'can be any unused column, just change C as needed
nextRow = Range("C" & Rows.Count).End(xlUp).Row + 1
'put the new entry into column C at bottom of list and
'show the row number the name was entered into with it
Range("C" & nextRow) = Target.Value & " [" & Target.Row & "]"
End If
End Sub


"Radha" wrote:

I have 2 columns. in column A I will enter a name. in column b I will enter a
number from 1 to 10. The names are not entered in the order 1 to 10 but
randomly. Example I can enter number 5 then 2 then 9 then 1 and so on. How
can I track the order in whick I names are entered. Can I do this on a
different column rather than tracking changes.
--
Radha