ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ListBox - Row Source problem (https://www.excelbanter.com/excel-programming/302672-listbox-row-source-problem.html)

unplugs[_39_]

ListBox - Row Source problem
 
It seems quite difficult to get an answer here... Anyway, anothe
question from me.. :P


My userform has a combobox and listbox. So, can I do such that, whe
the user choose their username in the combobox, the listbox wil
display onli the entries that the user made? and not display othe
users' entries?


Is it possible to do so?

Any help would be appreciated.
;

--
Message posted from http://www.ExcelForum.com


Bob Flanagan

ListBox - Row Source problem
 
If you double click on the combobox, you will be taken to the combobox's
change event code. In that procedure, you can then do something like:

Private Sub ComboBox1_Change()
Dim I As Integer
Dim J As Integer
Me.ListBox1.Clear
I = Me.ComboBox1.ListIndex
If I -1 Then
'code that populates based on entry
'for example if the data is stored on a sheet
'named mydata
For J = 1 To 10
Me.ListBox1.AddItem Sheets("mydata").Cells(J, I + 1).Value
Next
End If
End Sub

Bob Flanagan
Macro Systems
Delaware, U.S. 302-234-9857
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"unplugs " wrote in message
...
It seems quite difficult to get an answer here... Anyway, another
question from me.. :P


My userform has a combobox and listbox. So, can I do such that, when
the user choose their username in the combobox, the listbox will
display onli the entries that the user made? and not display other
users' entries?


Is it possible to do so?

Any help would be appreciated.
;)


---
Message posted from http://www.ExcelForum.com/




unplugs[_42_]

ListBox - Row Source problem
 
Thanks a lot Bob Flanagan.

and I realize 1 thing... that is the rowsource for listbox must be
open workbook... It can't refer to the close workbook.

:

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 01:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com