delulytric
New Member
- Joined
- Mar 15, 2019
- Messages
- 4
Hi, I'm a beginner in VBA and I'm not familiar with most of the code here. I read up on several threads about Worksheet_Change() and can't find something that suits to my need.
Currently, I'm doing a project and let's assume that I changed the price of fish from $2 to $4.
Sheet 1 (Original sheet)
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Name[/TD]
[TD]Price[/TD]
[TD]Quantity[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Chicken[/TD]
[TD]$2.50[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Fish[/TD]
[TD]$4.00[/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]
I want it to transfer the entire row 3 Fish and store it into a historical data sheet for record keeping purpose. Bear in mind that for every change, it should automatically update itself through a new row! I would also want a date changed on column D so that it is understood when the last person did change the price or quantity of the row itself.
Sheet 2 (Historical data sheet)
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Name[/TD]
[TD]Price[/TD]
[TD]Quantity[/TD]
[TD]Date Changed[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Fish[/TD]
[TD]$4.00[/TD]
[TD]3[/TD]
[TD]15 March 2019[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Fish[/TD]
[TD]$5.00[/TD]
[TD]3[/TD]
[TD]16 March 2019[/TD]
[/TR]
</tbody>[/TABLE]
I've search through the forum and sad to say I'm not very capable in handling VBA as opposed to my other projectmates. I only understood the start command Private Sub Worksheet_Change(), the end command and if intersect(target, range) is Nothing exit sub.
Any help here would be greatly appreciated here!
Currently, I'm doing a project and let's assume that I changed the price of fish from $2 to $4.
Sheet 1 (Original sheet)
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Name[/TD]
[TD]Price[/TD]
[TD]Quantity[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Chicken[/TD]
[TD]$2.50[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Fish[/TD]
[TD]$4.00[/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]
I want it to transfer the entire row 3 Fish and store it into a historical data sheet for record keeping purpose. Bear in mind that for every change, it should automatically update itself through a new row! I would also want a date changed on column D so that it is understood when the last person did change the price or quantity of the row itself.
Sheet 2 (Historical data sheet)
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Name[/TD]
[TD]Price[/TD]
[TD]Quantity[/TD]
[TD]Date Changed[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Fish[/TD]
[TD]$4.00[/TD]
[TD]3[/TD]
[TD]15 March 2019[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Fish[/TD]
[TD]$5.00[/TD]
[TD]3[/TD]
[TD]16 March 2019[/TD]
[/TR]
</tbody>[/TABLE]
I've search through the forum and sad to say I'm not very capable in handling VBA as opposed to my other projectmates. I only understood the start command Private Sub Worksheet_Change(), the end command and if intersect(target, range) is Nothing exit sub.
Any help here would be greatly appreciated here!
Last edited by a moderator: