Results 1 to 5 of 5

Thread: Combobox VBA update value worksheet

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Again not sure..

    Code:
    Private Sub ComboBox1_Change()
        
        Dim lngIndex    As Long
        
        With Me.ComboBox1
            lngIndex = .ListIndex
            If Not lngIndex = -1 Then
                [e1]= .List(lngIndex)
            End If
        End With
        
    End Sub
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  2. #2
    Junior Member
    Join Date
    Oct 2012
    Posts
    26
    Rep Power
    0
    Quote Originally Posted by Admin View Post
    Again not sure..

    Code:
    Private Sub ComboBox1_Change()
        
        Dim lngIndex    As Long
        
        With Me.ComboBox1
            lngIndex = .ListIndex
            If Not lngIndex = -1 Then
                [e1]= .List(lngIndex)
            End If
        End With
        
    End Sub
    Hi :D

    Thanks for your help, worked exactly how it should be .

    Private Sub ComboBox1_Change()

    Code:
        Dim lngIndex    As Long
        
        With Me.ComboBox1
            lngIndex = .ListIndex
            If Not lngIndex = -1 Then
                [DASHBOARD!C6]= .List(lngIndex)
            End If
        End With
        
    End Sub
    And i set the rowsource to Scenario.. works perfect.. Is there also a way to display the current value on loading the userform in the combobox?

Similar Threads

  1. Trim all Cells in a Worksheet - VBA
    By Admin in forum Excel and VBA Tips and Tricks
    Replies: 6
    Last Post: 08-21-2015, 08:22 AM
  2. Combobox Not Working In Excel Workbook Shared Mode
    By peter renton in forum Excel Help
    Replies: 15
    Last Post: 06-03-2013, 01:25 PM
  3. Print Nth Worksheet To Mth Worksheet using VBA
    By Ryan_Bernal in forum Excel Help
    Replies: 2
    Last Post: 02-28-2013, 06:57 PM
  4. Replies: 2
    Last Post: 11-17-2011, 07:49 PM
  5. Sort Worksheet by Color VBA
    By Admin in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 10-25-2011, 02:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •