Show rows on listbox on form

felipe0000

New Member
Joined
Mar 11, 2021
Messages
2
Office Version
  1. 2010
Platform
  1. Windows
Hi.
Im trying to make a manager for my non profit sports club. On the Attendance segment I want to pop up a form to do it in witch I add the date, select the class (Adults/Kids) and after that select on a listbox the members that showed up, but I need that the list contemplates only the active members only (Full name of the member only).
After that I want to add the new class date and attendance on a new column from the last class (to the left).

1615490437637.png


with this example

Im sorry not to be more specific.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
hi and welcome to MrExcel
assuming you have a user form designed with a listbox called ListBox1. Assuming the Sheet is Called "Sheet 1"

VBA Code:
Private Sub UserForm_Initialise()
    With Sheets("Sheet 1")
        For Row = 3 To .Cells(.Rows.Count, "A").End(xlUp).Row
            If .Cells(Row, 4) = "Active" Then
                ListBox1.AddItem .Cells(Row, 1) & " " & .Cells(Row, 2)
                ListBox1.List(ListBox1.ListIndex - 1, 1) = Row ' you will need an index to be able to save any data
            End If
        Next Row
    End With
End Sub
 
Upvote 0
Thanks a lot!!! it looks shorter than I thought it would be.
only one question (i feel stupid). what do you mean with needing an index?
 
Upvote 0
when the user chooses a name to edit... which row in the sheet will need to be changed?
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,936
Members
449,094
Latest member
teemeren

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