+ Reply to Thread
Results 1 to 8 of 8

listbox and freeform text in one cell?

  1. #1
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    listbox and freeform text in one cell?

    I am interested in knowing if there is a way to have a dropdown list and freeflow text in one cell.

    for example my dropdown list is of initials of my colleagues. After that I want to be able to write text (like "job complete" or "needs investigation) but all in the same cell. Is this possible?

    I ask as normally you would have a colomn for the dropdown and another colomn for cells but i have so much code in place that refers to certain cells that it would muck things up too much

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,982

    Re: listbox and freeform text in one cell?

    No, you can't do that. Your description of having another column for the text is the better solution.

    You also mention code, but if adding a column breaks the code then maybe you have a code design problem. Since you are using code to begin with, you could create a custom userform that is displayed when you click on particular cells, allows you to select from a list or combobox, add some text in a textbox, then concatenate them both together and store it in the cell.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Re: listbox and freeform text in one cell?

    the code i mention that will be broken is a lot of macro code that deals with formatting, sorting etc. I would need to change all the ranges in all the code if a new colomn was addded.

    Care to elaborate on your custom userform?

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,982

    Re: listbox and freeform text in one cell?

    Here is a demo.
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Re: listbox and freeform text in one cell?

    wow that is really great. I cant follow the logic i the code at all (my understanding is too basic!)

    How does it work if I wanted to place my inputvalue range to K18 onwards (K18:K190 to be specific)? By that I mean I want the userform to pop up if any cell in that range is selected.

    If Target.Count = 18 And Target.Column = 11 Then

    That doesnt seem to work for me.?

    Sorry for the noobness of it all!
    Last edited by nickmax1; 01-18-2013 at 07:30 AM.

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,982

    Re: listbox and freeform text in one cell?

    Here's more of an explanation with modifications for what you have described:

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Re: listbox and freeform text in one cell?

    strange i get an "method range of object global" error on your (most restricted) code above - but this seems to work:

    If Not Application.Intersect(Target, Range("K18:K190")) Is Nothing Then

    Ah just noticed why your code gave me an error, you missed out a "K" in your range definition.

    Any benefit to using your code over the code that works for me above?

    many thanks!!
    Last edited by nickmax1; 01-18-2013 at 08:31 AM.

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,982

    Re: listbox and freeform text in one cell?

    I did make an error, I missed the K. I compiled but did not run that code before posting it.

+ 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