+ Reply to Thread
Results 1 to 2 of 2

Change Cell Value Dependent Upon List Box

Hybrid View

  1. #1
    Registered User
    Join Date
    07-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    20

    Change Cell Value Dependent Upon List Box

    Hi, I'll start by saying thanks to every one that helps with this matter.

    I'd like to run a macro each time the value of a cell changes in a list box. More specifically, I have a Lookup function in cell F5 that is dependent upon information selected in cells F3 and F4. While this function works properly, it does not add room for a seperate user input should the user decide to input a different value. I figured if I just ran a macro that said "If Cell F3 = "Custom", then F5 = "User Input Value", Else "=VLOOKUP(.....)". Anyways, I'm looking for help on the matter, so if there is a much more efficient way to do this I'm more than welcome to suggestions.

    Thanks again!

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: Change Cell Value Dependent Upon List Box

    You don't say what kind of listbox or where it is, but this will work for ActiveX listbox on sheet (put in sheet code page), and Listbox on userform.

    Private Sub Listbox1_Change
    select case Range("F3").value
    Case "Custom"
       Range("F5").Value = "User Input Value"
    
    Case Else
       Range("F5").Formula = "=Vlookup..."
    End Select
    David
    (*) Reputation points appreciated.

+ 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