Update a value in an employee record but keep the old value as well

Ritzl

New Member
Joined
May 16, 2015
Messages
16
Hi all,
I have a nut to crack but do not know how. Hope anybody can help me with a full example. Imagine an employee file: Name, First Name, Rank, Salary etc. What I want to achieve is, if I change e.g. the salary of an employee in the table, that is shows the new salary but in a drop down list or so also the old one and the data until when it was valid. (Imaging the table has 100 employees and not all will be changed at the same data). Any idea how to solve this? Thx in advance to all Excel Gods and Gurus.:confused:
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
I would make a table to serve as a database. In this table you would list all salary assignments... so...

Name, First Name, Rank, Salary, Date Started, Date Ended

Then have your table that you described with each employee and it looksup the salary based on a date input or maybe it just shows most recent salary but your database will keep track of history.

1. table for database... you dont delete or overwrite records, you only add records

kpohiMN.png


2. table to lookup recent salary from database
 
Last edited:
Upvote 0
Try this:-
The code add/Update Cell comments i.e. the Salary in the target cell and the date.
NB:- Paste this code in the worksheet Module i.e. (Alt+F11")
Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Txt As String
     If Target.comment Is Nothing Then
        Target.Cells.NoteText Date & ":=" & Target.Value
     Else
        Txt = Target.Cells.NoteText
        Target.Cells.NoteText Txt & vbLf & Date & ":=" & Target.Value
     End If
Target.comment.Shape.TextFrame.AutoSize = True
End Sub
 
Last edited:
Upvote 0
Thx a lot, this would work but the disadvantage would be that I have multiple entries and would have difficulties to count eg. head-count.
 
Upvote 0
Many thanks, interesting idea, will check it out. Advantage I would not have multiple records for the same employee. Disadvantage I could not pull a report e.g. showing the salary development on a new worksheet when it comes to salary review.
 
Upvote 0

Forum statistics

Threads
1,215,676
Messages
6,126,161
Members
449,295
Latest member
DSBerry

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top