Selecting multiple rows from listbox for reporting

  • Thread starter Thread starter Brett9
  • Start date Start date
B

Brett9

Hi -
I want to offer the ability for a user to scroll through records
displayed in a listbox and then display the single record on a user
form report. Then I want to use Previous / Next buttons to scroll
through the records and display the chart. Sample code to help with
this would be much appreciated. If the sample code allows for multiple
selections from the list box, with scrolling through only the selected
records / rows, that would make my weekend!

I wanted to look at the code in the very nice Village Software samples
in Excel 2000, but they are password protected (hint?).

Thanks for a great forum!
Brett Strouss
bstrouss at sensoryarts.com
'www.pockethearo.com' (http://www.pockethearo.com)
 
Set the multiselect property of the listbox to true and the user can select
multiple records. It won't collapse the listbox to include only those
selected records unless you add a button that includes code to reload the
listbox with only the selected records.

See help on the selected property of the listbox for sample code.

Loading a listbox is pretty basic stuff - you either set the rowsource to
the range, or you use additem to add the rows or you can set the list or
column properties to an array.

Here are some references if you are looking for basic help on how to use a
userform:

http://support.microsoft.com/?id=168067
XL97: WE1163: "Visual Basic Examples for Controlling UserForms"

Microsoft(R) Visual Basic(R) for Applications Examples for Controlling
UserForms in Microsoft Excel 97

This Application Note is an introduction to manipulating UserForms in
Microsoft Excel 97. It includes examples and Microsoft Visual Basic for
Applications macros that show you how to take advantage of the capabilities
of UserForms and use each of the ActiveX controls that are available for
UserForms

http://www.microsoft.com/ExcelDev/Articles/sxs11pt1.htm
Lesson 11: Creating a Custom Form
Excerpted from Microsoft® Excel 97 Visual Basic® Step by Step.



http://support.microsoft.com/default.aspx?kbid=161514
XL97: How to Use a UserForm for Entering Data

http://support.microsoft.com/default.aspx?kbid=213749
XL2000: How to Use a UserForm for Entering Data


John Walkenbach's site:
http://j-walk.com/ss/excel/tips/userformtips.htm
Userform Tips

Peter Aiken Articles:

watch word wrap. the URL should all be one line.
Part I
http://msdn.microsoft.com/library/en-us/dnoffpro01/html/IntroductiontoUserFo
rmsPartI.asp
Part II
http://msdn.microsoft.com/library/en-us/dnoffsol02/html/IntroductiontoUserFo
rmsPartII.asp
 
Thanks for the solid reference info. I never got it to work the way I
expected. I ended up leaving out the multi-selection list box or combo
box and just manually scrolled through the list, displaying the
selected record identifier in a Text Box. That part works OK for this
iteration. Thanks for the help!
Brett
 
Thanks for the solid reference info. I never got it to work the way I
expected. I ended up leaving out the multi-selection list box or combo
box and just manually scrolled through the list, displaying the
selected record identifier in a Text Box. That part works OK for this
iteration. Thanks for the help!
Brett
 
Back
Top