Results 1 to 24 of 24

Activate combobox on active cell instead of doubleclick

Threaded View

  1. #1
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Activate combobox on active cell instead of doubleclick

    Good morning, I would like some help to modify a VBA code, if possible, that activates in column B sheet1 of the attached file, the comboboxes when the cell is active are now activated with doubleclick.

    Also, I would like to have the data read from the Data sheet and remove it from the sheet1 column I
    thank you


    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    Dim str As String
    Dim cboTemp As OLEObject
    Dim ws As Worksheet
    Set ws = ActiveSheet
    On Error GoTo errHandler
    
    If Target.Validation.Type = 3 Then
    Cancel = True
    End If
    
    Set cboTemp = ws.OLEObjects("TempCombo")
      On Error Resume Next
      With cboTemp
        .ListFillRange = ""
        .LinkedCell = ""
        .Visible = False
      End With
    On Error GoTo errHandler
      If Target.Validation.Type = 3 Then
        Application.EnableEvents = False
        str = Target.Validation.Formula1
        str = Right(str, Len(str) - 1)
        With cboTemp
          .Visible = True
          .Left = Target.Left
          .Top = Target.Top
          .Width = Target.Width + 15
          .Height = Target.Height + 5
          .ListFillRange = ws.Range(str).Address
          .LinkedCell = Target.Address
        End With
        cboTemp.Activate
      End If
      
    errHandler:
      Application.EnableEvents = True
      Exit Sub
    
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] ComboBox value variable from active cell
    By Catsonheat in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2019, 11:40 AM
  2. Activate/Deactivate Cell Based on ComboBox Selection
    By atalante_ in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-16-2018, 05:00 PM
  3. Copy active cell in before doubleclick script
    By Mimoa in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-22-2014, 05:07 PM
  4. Replies: 1
    Last Post: 12-03-2012, 08:55 AM
  5. Loop Through Active Windows and Activate
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-02-2011, 07:44 AM
  6. How to Activate a Sheet from a ComboBox
    By Amkey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2008, 05:45 PM
  7. ComboBox selection activate sub
    By matrixknow in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-08-2007, 03:15 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