victoria2207
New Member
- Joined
- Mar 9, 2018
- Messages
- 17
Good Afternoon, Please excuse me if something similar has already been posted. I am looking for a simple but robust way to deplete the value of a cell based on a common reference on another sheet. To clarify, Sheet 1 contains hundreds of rows of items in Column A with the current available value in Column B.
Sheet 2 to 34 have various different actions, each of which if carried out will deplete the available resources on Sheet 1, so:
Sheet 1:
[TABLE="width: 152"]
<tbody>[TR]
[TD]Reference
[/TD]
[TD]Value available
[/TD]
[/TR]
[TR]
[TD]AA100
[/TD]
[TD="align: right"]26
[/TD]
[/TR]
[TR]
[TD]AA101
[/TD]
[TD="align: right"]27
[/TD]
[/TR]
[TR]
[TD]AA102
[/TD]
[TD="align: right"]23
[/TD]
[/TR]
[TR]
[TD]AA103
[/TD]
[TD="align: right"]24
[/TD]
[/TR]
[TR]
[TD]AA104
[/TD]
[TD="align: right"]25
[/TD]
[/TR]
[TR]
[TD]AA105
[/TD]
[TD="align: right"]26
[/TD]
[/TR]
[TR]
[TD]AA106
[/TD]
[TD="align: right"]27
[/TD]
[/TR]
[TR]
[TD]AA107
[/TD]
[TD="align: right"]23
[/TD]
[/TR]
[TR]
[TD]AA108
[/TD]
[TD="align: right"]24
[/TD]
[/TR]
[TR]
[TD]AA109
[/TD]
[TD="align: right"]25
[/TD]
[/TR]
[TR]
[TD]AA110
[/TD]
[TD="align: right"]26
[/TD]
[/TR]
[TR]
[TD]AA111
[/TD]
[TD="align: right"]27
[/TD]
[/TR]
[TR]
[TD]AA112
[/TD]
[TD="align: right"]23
[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 2:
[TABLE="width: 106"]
<tbody>[TR]
[TD]Ref
[/TD]
[TD]Item1
[/TD]
[/TR]
[TR]
[TD]AA100
[/TD]
[TD="align: right"]5
[/TD]
[/TR]
[TR]
[TD]AA103
[/TD]
[TD="align: right"]6
[/TD]
[/TR]
[TR]
[TD]AA106
[/TD]
[TD="align: right"]4
[/TD]
[/TR]
[TR]
[TD]AA109
[/TD]
[TD="align: right"]3
[/TD]
[/TR]
[TR]
[TD]AA112
[/TD]
[TD="align: right"]5
[/TD]
[/TR]
</tbody>[/TABLE]
Essentially I want to reduce the 26 available of AA100 by 5 and AA103 by 6, AA104 by 4 etc. possibly using a button press?
I'm hoping there is already some VBA written or another simple way to achieve this.
TIA
Vic2207
Sheet 2 to 34 have various different actions, each of which if carried out will deplete the available resources on Sheet 1, so:
Sheet 1:
[TABLE="width: 152"]
<tbody>[TR]
[TD]Reference
[/TD]
[TD]Value available
[/TD]
[/TR]
[TR]
[TD]AA100
[/TD]
[TD="align: right"]26
[/TD]
[/TR]
[TR]
[TD]AA101
[/TD]
[TD="align: right"]27
[/TD]
[/TR]
[TR]
[TD]AA102
[/TD]
[TD="align: right"]23
[/TD]
[/TR]
[TR]
[TD]AA103
[/TD]
[TD="align: right"]24
[/TD]
[/TR]
[TR]
[TD]AA104
[/TD]
[TD="align: right"]25
[/TD]
[/TR]
[TR]
[TD]AA105
[/TD]
[TD="align: right"]26
[/TD]
[/TR]
[TR]
[TD]AA106
[/TD]
[TD="align: right"]27
[/TD]
[/TR]
[TR]
[TD]AA107
[/TD]
[TD="align: right"]23
[/TD]
[/TR]
[TR]
[TD]AA108
[/TD]
[TD="align: right"]24
[/TD]
[/TR]
[TR]
[TD]AA109
[/TD]
[TD="align: right"]25
[/TD]
[/TR]
[TR]
[TD]AA110
[/TD]
[TD="align: right"]26
[/TD]
[/TR]
[TR]
[TD]AA111
[/TD]
[TD="align: right"]27
[/TD]
[/TR]
[TR]
[TD]AA112
[/TD]
[TD="align: right"]23
[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 2:
[TABLE="width: 106"]
<tbody>[TR]
[TD]Ref
[/TD]
[TD]Item1
[/TD]
[/TR]
[TR]
[TD]AA100
[/TD]
[TD="align: right"]5
[/TD]
[/TR]
[TR]
[TD]AA103
[/TD]
[TD="align: right"]6
[/TD]
[/TR]
[TR]
[TD]AA106
[/TD]
[TD="align: right"]4
[/TD]
[/TR]
[TR]
[TD]AA109
[/TD]
[TD="align: right"]3
[/TD]
[/TR]
[TR]
[TD]AA112
[/TD]
[TD="align: right"]5
[/TD]
[/TR]
</tbody>[/TABLE]
Essentially I want to reduce the 26 available of AA100 by 5 and AA103 by 6, AA104 by 4 etc. possibly using a button press?
I'm hoping there is already some VBA written or another simple way to achieve this.
TIA
Vic2207