+ Reply to Thread
Results 1 to 15 of 15

Listbox search for 'cell address'

  1. #1
    Registered User
    Join Date
    01-29-2019
    Location
    Roermond
    MS-Off Ver
    365
    Posts
    25

    Listbox search for 'cell address'

    Dear Forum,

    Listbox1 filters data from another sheet into listbox 2
    In Listbox 2 I'd like to uptain the cell addres form a filtered item.
    HTML Code: 
    However, in the sheet with the filtered data the wanted address should be "B5", but because of the filtercriteria it returns B2.

    How can I 'vba' my way out of this and get the wanted result?

    Thanks in advance.

    Rudy

    P.s Needless to say I'm relatively new at VBA

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Listbox search for 'cell address'

    Hello Rudy,

    In the interest of time, can you please post a copy of your workbook. Looking back through old posts and code is not going to entice others to help you.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    01-29-2019
    Location
    Roermond
    MS-Off Ver
    365
    Posts
    25

    Re: Listbox search for 'cell address'

    Hello Leith,
    Adding attachments doesn't seem to work.

    Clicking the attachment button results in a small blank line.
    Am I missing something?

    Regards, Rudy

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Listbox search for 'cell address'

    Hello Rudy,

    It is probably not letting you post because you are new. You must have a certain number of posts before you can attach a workbook. Can you post the workbook to a public file share? If you can then you can post the link to the workbook. Otherwise, you can send it to me via email and I'll post it for you.

  5. #5
    Registered User
    Join Date
    01-29-2019
    Location
    Roermond
    MS-Off Ver
    365
    Posts
    25

    Re: Listbox search for 'cell address'

    Hi Leith,

    Sorry, I don't know how Public fileshare works. Never done that.
    If you don't mind I'd prefer to send the workbook by email.

    Do you have an emailaddress for me?

    Thanks, Rudy

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Listbox search for 'cell address'

    In case the issue is that you are not using the correct method for attaching... (not saying you are, but there have been issues)


    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  7. #7
    Registered User
    Join Date
    01-29-2019
    Location
    Roermond
    MS-Off Ver
    365
    Posts
    25

    Re: Listbox search for 'cell address'

    Another try
    Attached Files Attached Files

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Listbox search for 'cell address'

    Hello Rudy,

    I made a few changes to your code to make the cell address in column "A" appear in ListBox2. See the attached workbook.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    01-29-2019
    Location
    Roermond
    MS-Off Ver
    365
    Posts
    25

    Re: Listbox search for 'cell address'

    Hi Leith,

    Thank you, the line of code you put in returns the cell address for the item in listbox1, and does that fine.
    However, the items in listbox2 have 'a relation' with one item in listbox1, and I would like to get the cell address of the item in row B, sheet2 ("Blad2").

    Point is, that when listbox2 filters sheet2, it puts - for example - "Teststraat 5" with "IdAdres" 5 and "IDCls" 5 from B6 to B2, and "Teststraat 5" with "IdAdres" 5 and "IDCls" 6 from B7 to B3,
    I'd like to obain the cell address from the item in row B in "Blad2" despite filtering through listbox2.

    Does this make any sence?

    Regards, Rudy.

  10. #10
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Listbox search for 'cell address'

    Hello Rudy,

    I had a 50/50 shot at getting it right. Here is the updated version. This will display the cell address for the row in on "Blad2" as "$B$4:$D$4".
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    01-29-2019
    Location
    Roermond
    MS-Off Ver
    365
    Posts
    25

    Re: Listbox search for 'cell address'

    Hello Leith,

    And the other 50 percent is a hit :-)
    This is exactly what I was looking for.

    Thanks very much, also for your prompt replies.
    I appreciate it.

    Regards, Rudy

  12. #12
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Listbox search for 'cell address'

    Hello Rudy,

    Niets te danken! (Not sure if that is correct.) I'm glad to know it is working correctly now.

  13. #13
    Registered User
    Join Date
    01-29-2019
    Location
    Roermond
    MS-Off Ver
    365
    Posts
    25

    Re: Listbox search for 'cell address'

    :-) Right on the nose.

    I have one more question in this thread, if I may.
    How do I put the column 6 address in a string? As in dim x as string x= ??

  14. #14
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Listbox search for 'cell address'

    Hello Rudy,

    You can by declaring a variable as a String Type, since the address of a Range returns a string type. The address can be obtained from the cell or the ListBox.

    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    01-29-2019
    Location
    Roermond
    MS-Off Ver
    365
    Posts
    25

    Re: Listbox search for 'cell address'

    Thanks again Leith,

    Works like a charm.

+ 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. Address cell value(s) to search an aspx site
    By excelforumkeys in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-04-2017, 08:17 PM
  2. [SOLVED] Search range for hits and return cell address
    By Fno in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-28-2017, 07:42 AM
  3. Select cell based on address in ListBox column
    By emmakins in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-04-2015, 01:00 PM
  4. [SOLVED] How do I find address of cell after search value in range
    By josel2820 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-02-2013, 12:28 PM
  5. Find Cell Address After The Use Of A Search
    By readered in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-06-2012, 06:57 AM
  6. Search row and return cell address
    By cfaull in forum Excel General
    Replies: 6
    Last Post: 03-12-2011, 02:39 AM
  7. [SOLVED] Search Cell Address and Cell Names in VBA Editor
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-11-2005, 03:06 PM

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