+ Reply to Thread
Results 1 to 6 of 6

User forms - choosing location of your data to be shown in your user form

  1. #1
    Registered User
    Join Date
    07-09-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    24

    User forms - choosing location of your data to be shown in your user form

    Hi excelforums,

    Do any of you more experienced users know how to change how to decide where the userform gets the data to be shown in its listbox. I have spent a good deal of time trying to figure it out on my own but I still don't know how.

    The userform takes the data found in columns 'B' and 'D' of the "ME List" worksheet, but I would like to know how to change it so the userform takes the data from columns 'A' and 'D' instead. You can bring up the userform by clicking on either columns 'C' and 'D' of "Purchase Req"
    The userform code is:

    Please Login or Register  to view this content.
    Thank you so much,

    Jason
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    08-04-2010
    Location
    Adelaide, Australia
    MS-Off Ver
    Office 365
    Posts
    176

    Re: User forms - choosing location of your data to be shown in your user form

    Jason,

    I'm still new to Vba myself and I think I understand what your code is doing, but until someone more experienced comes along, try this...

    change this bit
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    Cheers,

    AJ
    Always grateful for the help here - thanks.

  3. #3
    Registered User
    Join Date
    10-18-2008
    Location
    michigan
    MS-Off Ver
    2010
    Posts
    88

    Re: User forms - choosing location of your data to be shown in your user form

    Hi jasonbwt,

    I’m not very experienced with macros. Most of what I have learned is from here.
    That being said,
    If you click on the properties of the userform in the visual basic screen and scroll down near the bottom, you will find “Row Source”. In the box next to it, put in where the data is.

    As an example, I have the data in T1:T13. For the Row source I have: T1:T13.

    I found that it was easier to edit the data this way than in the macro.
    I also have a userform that has the data in a different worksheet than where the userform pops up but in the same workbook. In that case I “ranged name” the data and used that name in the row source.

    Mike

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,621

    Re: User forms - choosing location of your data to be shown in your user form

    All you should need to do is change the columns referred to in the code that populates the list.

    Actually, now that I've had a closer look at the code all you need is 2 changes.

    The first one is changing the column to filter on.
    Please Login or Register  to view this content.
    [/code]
    The second is to change the column widths so the first column is visible but the 2nd isn't.

  5. #5
    Registered User
    Join Date
    07-09-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: User forms - choosing location of your data to be shown in your user form

    First of all, thank you to you 3 who helped me. You actually all helped me.
    Quote Originally Posted by Norie View Post
    All you should need to do is change the columns referred to in the code that populates the list.

    Actually, now that I've had a closer look at the code all you need is 2 changes.

    The first one is changing the column to filter on.
    Please Login or Register  to view this content.
    [/code]
    The second is to change the column widths so the first column is visible but the 2nd isn't.
    Hi Norie i had spent ages changing the number from FillLists i.e. FillLists 1,2,3,4 etc..but never worked. Now i changed the column widths too and it works. I obviously didnt understand how the column widths work but your solution works!!!!!!

    Thank you!,

    oh and mrl i tried your way but wasn't quite sure if it worked or not because of the code and the row source. i got an error. anyway maybe u shud explore Norie's method too.
    Jason

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: User forms - choosing location of your data to be shown in your user form

    @ jasonbwt

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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