+ Reply to Thread
Results 1 to 14 of 14

Listbox

  1. #1
    Registered User
    Join Date
    10-14-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    82

    Listbox

    Hi
    can someone please advise if this can be done, i am a surveyor and i am trying to create an application that would speed up my surveys, i have created a sample form to try and explain what i mean, i can write simple code to populate a listbox to a cell but this is more complex, i have created individual listboxes as i do not know how to create columns in a listbox, the user will pick items but not necessarily in an order and create the sentence they need.

    I have attached a sample

    thanks
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Listbox

    Hi

    You are talking about Multicolumn Listboxes

    These are very powerful.

    If you post a sample workbook I will create something for you.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Listbox

    To populate a multicolumn list box all you need to do is to tell the use form where to load its data from.

    Attached is one I created a while back.

    I have to go out for a bit. Peruse this an I will answer any questions when I get back.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    10-14-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    82

    Re: Listbox

    Hi
    Thanks for that, what i want to do is pick individual columns not rows, just like the sample file i attached

    thanks

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Listbox

    Hi I did two similar things in a programme I wrote for someone this summer.

    One was a user form that allowed the secretary to type a students email address by clicking on just a few command buttons.
    As the user form was initialised it read the students name and surname into the command buttons as captions. the @ was another command button as were . and _.
    I found that very effective.

    A similar solution was effective in allowing the secretary to type foreign names as I used command button captions to represent foreign characters.

    So what I am suggesting is that you use command buttons to create a user form keypad.

  6. #6
    Registered User
    Join Date
    10-14-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    82

    Re: Listbox

    Not sure what you mean. I will be using a touch screen tablet when I am out on site carrying out surveys, I will use a. Stylus to chose items.

  7. #7
    Registered User
    Join Date
    10-14-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    82

    Re: Listbox

    Hi
    I think I know what you mean, would you be able to show me a sample please.
    Thanks

  8. #8
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Listbox

    Hi

    I managed to knock something together for you.

    Try the sample file. This is work in progress.


    Please Login or Register  to view this content.

    Please Login or Register  to view this content.


    All this type of code was prepared in excel and pasted into vba.
    Frankly I didn't want to ammend the code 100 times.

    So it is simplicity itself to programme 10, 000 buttons if needed.

    It calls the Text Add subroutine and passes the command button number to it.

    Please Login or Register  to view this content.


    Finally I messed around trying to get multiple pages to work like the above.
    If the commandbuttons are on page one of a multipage userform.

    And you have 40 lines of data in the data sheet instead of my 4.

    This code inserts 3 more pages and copies the buttons to the three pages so you have 400 buttons.
    However I couldn't get the buttons to get filled with the correct text.

    That is a problem for wednsday night.



    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 11-11-2013 at 10:21 PM.

  9. #9
    Registered User
    Join Date
    10-14-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    82

    Re: Listbox

    I think you are a genius, i will look at this in more detail

    thanks very much

  10. #10
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Listbox

    This macro will create the programme code for your command buttons.

    Ruin it in a new spread sheet and copy the resultant code into VBA.

    I just ran it and selected 10. So the user form will support 10 pages and 10000 command buttons.

    Please Login or Register  to view this content.

  11. #11
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Listbox

    I finally got the Multi page User form Built
    [ But it isn't quite right At the Moment] another Excel issue means the dynamic buttons don't work].

    There is a bug in Excel when you copy the controls from one Multi page to another that I had to work around.

    Each page is populated using 10 rows from your data sheet.

    Column A is the Page Name. Columns B to K become your button text.

    I now intend to create some word processor control buttons to complete this task.

    But in the meanwhile have a play with this sample.
    Attached Files Attached Files
    Last edited by mehmetcik; 11-12-2013 at 08:09 PM.

  12. #12
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Listbox

    Hey

    I have finished with this.

    Over to you.

    Enjoy.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    10-14-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    82

    Re: Listbox

    Thanks ive had computer problems so i dont have excel on my machine, i will install tonite and have a look

    thanks again iwill be in touch

  14. #14
    Registered User
    Join Date
    10-14-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    82

    Re: Labels and textbox

    Hi Mehmetcik

    I have been playing about with what you done and its very good, i have been looking at using labels instead of buttons and populating into a text box, i do not know the code for the label text to follow on in sequence, the text from label2 overwrites text from lable1, can you advise on the code please the textbox will then populate onto a worksheet.

    I have attached the file.

    thanks again for all your input.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Having problems populating a multicolumn listbox changing Listbox column with a loop.
    By Aristizabal95 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2013, 12:41 PM
  2. userform listbox
    By tsiguy96 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-14-2013, 11:09 PM
  3. [SOLVED] Indexing proper range in listbox depending on selection in previous listbox
    By bloodmeat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2013, 02:31 PM
  4. Listbox to Listbox, no duplicates & submitting same UserForm data for each Listbox entry.
    By jamieswift1977 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2012, 12:18 PM
  5. Replies: 12
    Last Post: 08-28-2012, 07:09 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1