Consulting

Results 1 to 5 of 5

Thread: Macro to make userform appear when clicked anywhere in Column D

  1. #1
    VBAX Regular
    Joined
    Apr 2015
    Posts
    73
    Location

    Macro to make userform appear when clicked anywhere in Column D

    Items are maintained in column A.

    When clicked on search a userform pops-up which allows the user to either -
    type and select the item, or
    simply select the item

    The selected item is entered into the cell which is selected.

    I'm looking for a macro that can make the userform pop-up when the user either clicks anywhere in column D or if any cell in column D is selected.

    Have attached sample sheet.
    Attached Files Attached Files

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
      If Not Intersect(Target, Range("D:D")) Is Nothing Then _
      frmListPicker.Show
    End Sub
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Regular
    Joined
    Apr 2015
    Posts
    73
    Location
    Above code makes the userform appear, but there is a problem.

    Actual userform has a text box and a list box. The list box has a list of items from which the user selects the item. The selected item is then entered in Column D.

    Above code gives a blank list box.

    About the user form -

    Contains 2 boxes namely text box and list box.

    Text box - when part of the word is typed the list box will populate items accordingly.
    List box- items from column A is reflected here

    Edit -
    Sample sheet will give an idea about the explanation I have given

  4. #4
    VBAX Expert mperrah's Avatar
    Joined
    Mar 2005
    Posts
    744
    Location
    Try this, but add it to the sheet code page not a module
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
         
        If Not Intersect(Target, Range("D:D")) Is Nothing Then _
        Call DynamicSearch
    End Sub

  5. #5
    VBAX Regular
    Joined
    Apr 2015
    Posts
    73
    Location
    Well.... mperrah.... You did it Again

    Thanks... GOD Bless You

Posting Permissions

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