VB code help!

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?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,222,143
Messages
6,164,178
Members
451,880
Latest member
2da

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