+ Reply to Thread
Results 1 to 3 of 3

Listbox selection relative to last row

  1. #1
    Registered User
    Join Date
    04-24-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2010
    Posts
    32

    Listbox selection relative to last row

    Hi there

    I'm trying to post values from a multiselect listbox into columns 17 to 19, whilst also ensuring they are posted to the last row.

    The bit in red I just cant work out

    Any help appreciated

    Thanks


    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Listbox selection relative to last row

    Hi Biffer,

    I hope I interpreted your requirements correctly:
    a. Find the Last Row in Sheet 'Data Refined'
    b. Use the row after the Last Row
    c. Put up to 3 items from the ListBox in the row after the Last Row starting at column 17 (= Q).

    Please let me know if this is not what you want.

    Try the following code. I removed the items that you weren't having problems with for ease of debugging. It is easier for me to debug when I add extra variables such as bItemBeenSelected.

    Please Login or Register  to view this content.
    The following may help you now and in the future:
    Debugger Secrets:
    a. Press 'F8' to single step (goes into subroutines and functions).
    b. Press SHIFT 'F8' to single step OVER subroutines and functions.
    c. Press CTRL 'F8' to stop at the line where the cursor is.
    d. 'Left Click' the margin to the left of a line to set (or clear) a BREAKPOINT.
    e. Press CTRL 'G' to open the IMMEDIATE WINDOW. 'debug.print' statements send their
    output to the IMMEDIATE WINDOW.
    f. Select View > Locals to see all variables while debugging.
    g. To automatically set a BREAKPOINT at a certain location put in the line:
    'Debug.Assert False'
    h. To conditionally set a BREAKPOINT at a certain location put in lines similar to:
    if i >= 20 and xTV20 > 99.56 then
    Debug.Assert False
    endif
    i. A variable value will be displayed by putting the cursor over the variable name.

    Lewis

  3. #3
    Registered User
    Join Date
    04-24-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Listbox selection relative to last row

    Apologies for the late response...this works great, thanks LJ

+ 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. [SOLVED] Listbox Selection/Highlight is lost after changing Listbox BackColor
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2014, 10:43 PM
  2. [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
  3. Replies: 12
    Last Post: 08-28-2012, 07:09 AM
  4. Multi select Listbox Items selection based on other Listbox item selection.
    By srinivassathi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-20-2011, 05:53 AM
  5. Replies: 0
    Last Post: 11-30-2005, 12:50 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