bradenkeith
New Member
- Joined
- May 4, 2014
- Messages
- 32
Hey everyone, I'm in need of some vba assistance.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD](on Sheet 1)[/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Game[/TD]
[TD]Points Earned[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1 (variable)[/TD]
[TD]5368[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Table1 (on Sheet 2)[/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Game[/TD]
[TD]Points Earned[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]5368[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]4[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]5[/TD]
[TD]3752[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]6[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]7[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]8[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]9[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]10 (etc...)[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Considering the visual aids above, here is what I'm looking to accomplish:
I have a spinner that changes the value of Cell A2 by increments of 1, and I have already written the code that pulls the data from Table1 to Cell B2 depending on the value of Cell A2. For example, if I use the spinner to change A2 to "5," then the value of cell B2 will automatically update to "3752." What I need is a string of code that will input data into Table1 (on Sheet 2) based on the value entered into Cell B2 (on Sheet 1). For example, if the value of Cell A2 were changed to 3, Cell B2 would be blank. If I were then to enter "5427" for example, I would like this value to then reflect in cell B4 (on Sheet 2). That way, when I change the value of cell A2 away from and back to 3, It would automatically recall "5427" in cell B2. I hope this makes sense. To clarify, I need to accomplish this with Worksheet_Change. Can it be done?
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD](on Sheet 1)[/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Game[/TD]
[TD]Points Earned[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1 (variable)[/TD]
[TD]5368[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Table1 (on Sheet 2)[/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Game[/TD]
[TD]Points Earned[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]5368[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]4[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]5[/TD]
[TD]3752[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]6[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]7[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]8[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]9[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]10 (etc...)[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Considering the visual aids above, here is what I'm looking to accomplish:
I have a spinner that changes the value of Cell A2 by increments of 1, and I have already written the code that pulls the data from Table1 to Cell B2 depending on the value of Cell A2. For example, if I use the spinner to change A2 to "5," then the value of cell B2 will automatically update to "3752." What I need is a string of code that will input data into Table1 (on Sheet 2) based on the value entered into Cell B2 (on Sheet 1). For example, if the value of Cell A2 were changed to 3, Cell B2 would be blank. If I were then to enter "5427" for example, I would like this value to then reflect in cell B4 (on Sheet 2). That way, when I change the value of cell A2 away from and back to 3, It would automatically recall "5427" in cell B2. I hope this makes sense. To clarify, I need to accomplish this with Worksheet_Change. Can it be done?