+ Reply to Thread
Results 1 to 7 of 7

Send list box value to first unused cell in column

  1. #1
    Forum Contributor
    Join Date
    01-07-2006
    Location
    San Jose, CA
    MS-Off Ver
    2007, 2016
    Posts
    115

    Send list box value to first unused cell in column

    I want to send the current ListBox value to a list in column U via a Command Button click. The following code works somewhat except that it starts the list after the used cells in the "middle" of column U, rows 36 to 3000 instead at row 2, the first unused row.

    Can anyone suggest how to modify the code place list box values starting in the first unused cell in column?

    Please Login or Register  to view this content.
    Part II if I am allowed to request at the same time, is to simultaneously place the value in cell P32 in a list in column V?

    Can the above code be modified to place both the current list box value in the first unused cell in a list in column U, while at the same time placing the current value in cell P32 in a list starting at first unused cell in a list in column V.

    Any help is greatly appreciated.

    Thanks,

    Art

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    13,051
    I tested the posted code; it works as expected. So I'm not sure what you mean by "first unused cell". If you have a column with some groups of used cells with blank cells in between, then that code won't work; you'll have to check each cell in the entire column for blanks. It would help if you posted a copy of your workbook.
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    01-07-2006
    Location
    San Jose, CA
    MS-Off Ver
    2007, 2016
    Posts
    115
    Ben,

    Thanks for your response. What is happening is that the listbox value is placed in cell U3001 starting the list at that cell instead of cell U2, under the column heading in U1. U2 is the first unused cell in column U. Cells U2:U35 are blank while there numerical values in cells U36:U3000.

    Can the code that I posted be modified to place the listbox list value to begin in cell U2?

    Thanks,

    Art

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    13,051
    Try the following test code:

    Please Login or Register  to view this content.
    Last edited by protonLeah; 08-18-2008 at 12:03 AM.

  5. #5
    Forum Contributor
    Join Date
    01-07-2006
    Location
    San Jose, CA
    MS-Off Ver
    2007, 2016
    Posts
    115
    I tried putting your code in as follows:

    Please Login or Register  to view this content.
    When I execute the code, I receive an error 9, "subscript out of range" message. Am I doing something wrong?

    Any suggestions?

    Art

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try

    Please Login or Register  to view this content.
    Last edited by royUK; 08-18-2008 at 05:02 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  7. #7
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    13,051
    What are your sheet names? You may need to replace the 'sheet1' in:
    'find the last row in column V
    LastV = Sheets("Sheet1").Cells(Rows.Count, "V").End(xlUp).Row
    with the actual sheet/tab name.

+ 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