PDA

View Full Version : [SOLVED:] Macro to make userform appear when clicked anywhere in Column D



Silver
05-28-2015, 09:55 AM
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.

SamT
05-28-2015, 10:22 AM
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, Range("D:D")) Is Nothing Then _
frmListPicker.Show
End Sub

Silver
05-28-2015, 10:47 AM
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

mperrah
05-28-2015, 11:42 AM
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

Silver
05-28-2015, 11:52 AM
Well.... mperrah.... You did it Again

Thanks... GOD Bless You