VenkateshV
New Member
- Joined
- Dec 7, 2017
- Messages
- 1
Hi Folks,
I'm relatively beginner and new to this forum. and appreciate if could help me to get the coding idea How to Log Audit trail of a particular cell or cells of a Worksheet
Say I have a workbook where i have worksheet "Sheet1" where the records are displayed as indicated below.
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Val1[/TD]
[TD]val2[/TD]
[TD]val3[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]2[/TD]
[TD]Apple[/TD]
[TD]2 Apple[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]5[/TD]
[TD]Orange[/TD]
[TD]5 Orange[/TD]
[/TR]
</tbody>[/TABLE]
Where fields Va1, and val3 is text and val3 is a formula based cell displays the final result. (i.e. concatenates val1 & Val2 and displays as a final string value)
Audit Log Population part
Now i start editing the val1 & val2 fields in a later date and wanted to know the full audit log trail of cells val1 to val3, with details like
1) what is old value , 2) what is new value and 3) Time of change Date & Time informations
and get the audit log populated in another sheet "Logs" within this same workbook.
On the "Logs" Worksheet which basically resembles same as "Sheet1", i want all the audit trail logs of the individual cell changes get populated on the same cells appended one after the other and should look like below.
say after i have performed 2 changes on my val1 & val2
[TABLE="class: grid, width: 750"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Val1[/TD]
[TD]Va2[/TD]
[TD]val3[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]old, new, Time
2, 3, 08-Dec-17 09:09:02
3, 5, 09-Dec-17 10:13:11[/TD]
[TD]old, new, Time
Apple, grape, 08-Dec-17 09:10:02
grape, cherry, 09-Dec-17 10:13:15[/TD]
[TD]old, new, Time
2 Apple, 3 grape, 08-Dec-17 09:10:02
3 grape, 5 cherry, 09-Dec-17 10:13:15[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]old, new, Time
5, 4, 08-Dec-17 09:09:01
4, 2, 09-Dec-17 10:13:13[/TD]
[TD]old, new, Time
Orange, Fir, 08-Dec-17 09:10:02
Fir, grape, 09-Dec-17 10:13:18[/TD]
[TD]old, new, Time
5 Orange, 4 Fir, 08-Dec-17 09:10:02
4 Fir, 2 Grape, 09-Dec-17 10:13:18[/TD]
[/TR]
</tbody>[/TABLE]
Kindly help me a simple and efficient VBA coding by which i can achieve above.
Many thanks in advance for your support.
Regards
Venkat
I'm relatively beginner and new to this forum. and appreciate if could help me to get the coding idea How to Log Audit trail of a particular cell or cells of a Worksheet
Say I have a workbook where i have worksheet "Sheet1" where the records are displayed as indicated below.
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Val1[/TD]
[TD]val2[/TD]
[TD]val3[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]2[/TD]
[TD]Apple[/TD]
[TD]2 Apple[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]5[/TD]
[TD]Orange[/TD]
[TD]5 Orange[/TD]
[/TR]
</tbody>[/TABLE]
Where fields Va1, and val3 is text and val3 is a formula based cell displays the final result. (i.e. concatenates val1 & Val2 and displays as a final string value)
Audit Log Population part
Now i start editing the val1 & val2 fields in a later date and wanted to know the full audit log trail of cells val1 to val3, with details like
1) what is old value , 2) what is new value and 3) Time of change Date & Time informations
and get the audit log populated in another sheet "Logs" within this same workbook.
On the "Logs" Worksheet which basically resembles same as "Sheet1", i want all the audit trail logs of the individual cell changes get populated on the same cells appended one after the other and should look like below.
say after i have performed 2 changes on my val1 & val2
[TABLE="class: grid, width: 750"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Val1[/TD]
[TD]Va2[/TD]
[TD]val3[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]old, new, Time
2, 3, 08-Dec-17 09:09:02
3, 5, 09-Dec-17 10:13:11[/TD]
[TD]old, new, Time
Apple, grape, 08-Dec-17 09:10:02
grape, cherry, 09-Dec-17 10:13:15[/TD]
[TD]old, new, Time
2 Apple, 3 grape, 08-Dec-17 09:10:02
3 grape, 5 cherry, 09-Dec-17 10:13:15[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]old, new, Time
5, 4, 08-Dec-17 09:09:01
4, 2, 09-Dec-17 10:13:13[/TD]
[TD]old, new, Time
Orange, Fir, 08-Dec-17 09:10:02
Fir, grape, 09-Dec-17 10:13:18[/TD]
[TD]old, new, Time
5 Orange, 4 Fir, 08-Dec-17 09:10:02
4 Fir, 2 Grape, 09-Dec-17 10:13:18[/TD]
[/TR]
</tbody>[/TABLE]
Kindly help me a simple and efficient VBA coding by which i can achieve above.
Many thanks in advance for your support.
Regards
Venkat