+ Reply to Thread
Results 1 to 2 of 2

User Form combo box populates the wrong cell in worksheet

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-11-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    245

    User Form combo box populates the wrong cell in worksheet

    Hello -

    A sample workbook with my VBA code is attached.

    First, I am trying to populate a worksheet via a User Form. Columns A & B may contain data between rows 6 and 20 though in my attached example I only have data across row 6. My User Form contains a combo box with up to five valid values (codes 1,2, 3, 4 & 5). In my example, the valid value selected from the combo box needs to populate cell C6. However, because text is present in cells A6 & B6, the valid value I select from the combo box fills cell C7 instead of C6. Were I to add values in columns A & B across row 7, the valid value selected from the combo box fills cell C8.

    Thanks for any help!

    Grilleman
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: User Form combo box populates the wrong cell in worksheet

    You were finding the last row with data in and then going to the one below.
    lRow = ws.Cells(Rows.Count, 1).End(xlUp).Row
    makes it populate C6
    If someone has helped you then please add to their Reputation

+ 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. form populates the wrong data sheet
    By zak.horrocks in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-15-2014, 10:25 AM
  2. Replies: 1
    Last Post: 08-28-2013, 05:04 PM
  3. Create a User form that populates another sheet in excel with data from Access.
    By laras08 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-01-2013, 04:03 PM
  4. Replies: 0
    Last Post: 07-11-2012, 01:42 PM
  5. Error when populating cell with “Time” from combo box in user form
    By jwala in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-07-2010, 09:01 AM

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