+ Reply to Thread
Results 1 to 3 of 3

Match ComboBox with dynamic range, then add Textbox1 to dynamic range

  1. #1
    Registered User
    Join Date
    11-20-2011
    Location
    Trondheim, Norway
    MS-Off Ver
    Excel 2007
    Posts
    31

    Match ComboBox with dynamic range, then add Textbox1 to dynamic range

    Hi,

    I need to add a TextBox1 value (number, no decimals) to the correct cell in Sheet1. Which cell to add is dependant on choice made in ComboBox1 (numeric values). I have a code (attached) in UserForm1 that allows the user to add data to the range. The range is then populated in UserForm2, ComboBox1.

    My problem is to match user choice in ComboBox1 with values in dynamic range ("L7").end(xlDown).Row, then add TextBox1 value to the adjacent cell to the right. I.e if the matching cell is L7 then the value of TextBox1 should be added to the existing value in cell M7.

    I'm lost here and in need of an expert


    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Match ComboBox with dynamic range, then add Textbox1 to dynamic range

    Try something like this (not tested).

    It uses the Combobox's Listindex of the selected item to offset from cell L7 e.g.; L7 is index 0, L8 is index 1... etc.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    11-20-2011
    Location
    Trondheim, Norway
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Match ComboBox with dynamic range, then add Textbox1 to dynamic range

    Thank you very much Alphafrog. The code is perfect

+ 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. activex combobox and dynamic named range
    By lcsw in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-22-2013, 05:30 PM
  2. [SOLVED] ComboBox with Dynamic range
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-13-2013, 01:28 AM
  3. ComboBox Dynamic Range
    By alrichar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-14-2012, 10:55 AM
  4. Combobox Rowsource Dynamic Range
    By roy__lam in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-06-2012, 09:44 AM
  5. Populate a combobox in a userform with a dynamic range.
    By BigBas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-23-2007, 01:12 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