+ Reply to Thread
Results 1 to 4 of 4

ComboBox value variable from active cell

  1. #1
    Forum Contributor
    Join Date
    08-14-2016
    Location
    Warrington, England
    MS-Off Ver
    MS 365
    Posts
    168

    ComboBox value variable from active cell

    Hi all,

    i have a UserForm with a ComboBox in it. When the UserForm is opened I want the value in the ComboBox to always equal the value in column D that is the same row as the active cell. For example, it would be irrelevant which cell i select in Row 10. If my active cell is H10, AF10, G10 etc. when the UserForm opens the ComboBox will always equal D10, or if my active cell is on row 100 it will always equal D100 etc.

    In the same UserForm I also have a submit button which will take the values from TextBox and ComboBox and paste them to cell ranges. Upon hitting submitBtn i want the value in the ComboBox to always be pasted back to the D column on the activecell row. Again, for example it is irrelevant what cell I am in on that row, if I am in cell H10, AF10, G10, when I hit submit the value in D10 will update to the ComboBox value.

    This way when I open the UserForm the ComboBox will be populated with whatever is in D on that row, however if i change the entry in the ComboBox and then hit the submit buttion, the value in D will be changed to the new ComboBox value.

    Here is my code so far which shows two textboxes values on opening the userform based on activecell.

    Please Login or Register  to view this content.
    Here is my code so far which shows two textboxes posting data to the activecell when the submit button is clicked.

    Please Login or Register  to view this content.
    Excel Beginner

  2. #2
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,009

    Re: ComboBox value variable from active cell

    Maybe this:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    08-14-2016
    Location
    Warrington, England
    MS-Off Ver
    MS 365
    Posts
    168

    Re: ComboBox value variable from active cell

    That worked perfectly! thanks! can't believe it was something as simple as that, i've been trying to do all kinds of offset/indirect/index formulas.

    Marks as solved and rep added!

  4. #4
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,009

    Re: ComboBox value variable from active cell

    You're welcome, glad to help, & thanks for the feedback.

+ 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. Setting Active Cell as a variable.
    By xZOMBI3H3ADx in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-29-2015, 02:54 PM
  2. [SOLVED] Setting a Public Variable = the Active Cell
    By slm10 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-21-2014, 07:56 AM
  3. [SOLVED] Need to pass the active cell to a String Variable
    By Darth269 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-17-2014, 06:37 PM
  4. Make the active worksheet name a variable when using .CELL function
    By slopsy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2013, 04:24 AM
  5. [SOLVED] How to put content of active cell in variable?
    By obgle in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-20-2012, 02:08 PM
  6. sum from e8 to variable active cell.
    By stevekirk in forum Excel General
    Replies: 6
    Last Post: 09-25-2006, 03:00 AM
  7. name variable with 3 first characters of active cell
    By shark102 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-21-2005, 10:05 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