Use Check Box Value to Auto Fill Table

madkinson

Board Regular
Joined
Dec 17, 2004
Messages
113
Office Version
  1. 365
Platform
  1. Windows
We have an idea that should reduce keying errors when a user enters a bill of lading in our ticketing system. I've developed a simple Excel sheet with a list of all available rail cars. The can use a "Select All" button to select all cars then uncheck the ones that aren't being used for this particular train (each train has about 125 cars).

What I can't figure out is how to write code that would automate the process where the user would click an "Add Cars" button and the code would take each line where the box is checked and do a VLOOKUP to fill in the rail car number selected as well as the rest of the values for that car as shown in the second attachment.

Maybe a VLOOKUP isn't the best solution? Any help is greatly appreciated. Thanks.
 

Attachments

  • Sheet1.jpg
    Sheet1.jpg
    29.7 KB · Views: 11
  • 1672850938467.png
    1672850938467.png
    17.6 KB · Views: 13

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Let me make another try at this.

I have a list of Railcars that users will choose selected ones when building a train. There are about 130 cars in each train so typing them in manually has produced many user errors. I was thinking I could write code that would look at each checked car number, do an INDEX/MATCH on a second sheet, and write that number plus weight, date, etc from the second sheet to a blank sheet. I am really struggling with this so I would really appreciate any help provided.

The first sheet is the one where the user would check the box next to each car # to be built into the train. It's actually easier to check them all then have them deselect the cars they don't need.

Dolese Rail Cars- Tare Weight- Gross Weight_Macro_Version_MrExcel.xlsm
ABCD
1Equipment IdCol
2OFOX88006TRUE
3OFOX88011TRUE
4OFOX88128
5OFOX88161TRUE
6OFOX88169TRUE
7OFOX88177
8OFOX88186TRUE
9OFOX88189TRUE
10OFOX88197
11OFOX88231TRUE
Railcars


The second sheet is the one used for the lookup. There are 2 blank columns that will be filled in on the 3rd sheet with a sequential number.

Dolese Rail Cars- Tare Weight- Gross Weight_Macro_Version_MrExcel.xlsm
ABCDEFGHIJK
1LocationDateTrain #Ref #Track Vehicle IDGrossNetQtyLoad StatusIn/Out Status
21511/9/20231OFOX88006268000216000108LI
31511/9/20231OFOX88011268000216000108LI
41511/9/20231OFOX88128268000216000108LI
51511/9/20231OFOX88161268000216000108LI
61511/9/20231OFOX88169268000216000108LI
71511/9/20231OFOX88177268000216000108LI
81511/9/20231OFOX88186268000216000108LI
91511/9/20231OFOX88189268000216000108LI
101511/9/20231OFOX88197268000216000108LI
111511/9/20231OFOX88231268000216000108LI
CarData


The third sheet is what I hope to end up with.

Dolese Rail Cars- Tare Weight- Gross Weight_Macro_Version_MrExcel.xlsm
ABCDEFGHIJK
1LocationDateTrain #Ref #Track Vehicle IDGrossNetQtyLoad StatusIn/Out Status
21511/9/2023111OFOX88006268000216000108LI
31511/9/2023122OFOX88011268000216000108LI
41511/9/2023133OFOX88161268000216000108LI
51511/9/2023144OFOX88169268000216000108LI
61511/9/2023155OFOX88186268000216000108LI
71511/9/2023166OFOX88189268000216000108LI
81511/9/2023177OFOX88231268000216000108LI
Sheet1
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

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