VBA Listbox Amend selected item

OwenWeaver

New Member
Joined
Apr 6, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Firstly can I just say how amazing these Excel forums are.

I have found solutions to nearly every problem I've ever had in Excel on some forum or another whether it be a formula issue or a VBA issue. So yeah, thank you all!

Now, this feels like a relatively simple issue and it most likely is, but I'm a race mechanic not a coder or dev person so please be mindful of that ;P

I have a tyre log sheet with 8 columns which are populated using another userform and click "save" and it writes to a dynamic table (TyreSetLogTable).
The first two columns ([Set Name] and [Set Type]) are populated with the information from said userform. This works great, I have a close button that unloads the form and then 6 successive columns that are populated by formulas. So basically, you load a Tyre Set (Set Name) and it's type (Slick/Wet) and once in the table will slowly populate with information such as the mileage and laps that tyre has done. I also use these set names in combo boxes in another userform that allows me to see which sets I have available to me etc.

All good. But now I'd like to keep this data in the TyreSetLogTable so that I can keep all the information that's relevant to that tyre set but I'd like to mark it as "Not in Use" so that I can no longer select it from another form. So, with this in mind I have created a 9th column [In Use] and simply want it to say "True" or "False". I want a userform that has two command buttons (Delete - cmdbDelete) and (Return - cmdbRTN). and a listbox that populates using date in TyreSetLogTable (columns 1,2,4,5 / [Set Name] [Set Type] [Total Laps] [Total KM]) only if column 9 = "True".

When a user selects say "set A5" from the listbox and hits the cmdbDelete button I want it to simply change the value of column 9 to "False". They can then return to a previous userform "Tyre Input Form" when hitting the cmbdRTN button.

*****************************************************

On a side note when I think about it, in my other Userform that contains a comboBox comboTyre, can I show only values of [TyreSetLogTable[Tyre Set]] if column 9 = "True", at the moment that is simply using this code to populate the combobox:

Dim i As Long
For i = 2 To Sheet10.Range("A1000").End(xlUp).Offset(0, 0).Row
Me.comboTyre.AddItem Sheet10.Cells(i, 1).Value
Next i

Anyways, any advice would be amazing!

Owen
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Watch MrExcel Video

Forum statistics

Threads
1,130,342
Messages
5,641,592
Members
417,224
Latest member
llama9207

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
Top