VBA code to highlight dice results on cards

Cquake

Board Regular
Joined
Dec 12, 2017
Messages
57
Office Version
  1. 2016
Platform
  1. Windows
I am not sure if this can be done but what I am attempting to do is to have the 4 areas above interact with the pitcher/batter cards on the left and right. The visiting batters card is always on the left with the home team pitchers card which will interact with the batters card sits next to it. The right side is the home team batter and the visiting team pitcher. These are all generated from a drop down list located in the "Lineups" tab using the Vlookup command to fill the cards in.

The Visitor/Home buttons let the excel sheet know which side of the screen the pitch dice and batters dice will be looking for. Depending on which button (Visiting or Home side) is in use the excel VBA command would then read the "pitch" dice first and locate the roll number matching it and highlight that area in yellow. The second dice "Batters" would then be rolled to find the result. In this case as you can see the roll of 27 would fall in the 2B area 24-27 under the "Tough" category and highlight that area. If the roll had been 10 (pitch) and 56 (Batter) then the line 10 - IN PLAY would highlight in yellow and since 56 is greater than any number under "IN PLAY" it would then highlight the G1 line and 54-61 under the out column.

Is it possible to tie all of this together (The Visitor/Home Pitch,batter and highlight sequence in one VBA code? Any help would be appreciated.

1598652798371.png
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,213,557
Messages
6,114,288
Members
448,563
Latest member
MushtaqAli

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