Open list when cell in column gets focus, and append term in list to text

davidmyers

Board Regular
Joined
Jan 29, 2017
Messages
88
Office Version
  1. 2016
Platform
  1. Windows
Hi, I have columns that contain text, each column has a list of terms that are related to the text in the cells of that column.
What I would like/need your help to do is:
1. When a cell in one of the columns gets focus a list of the relevant terms for that column will open - and remain open till a cell in another column gets focus.
2. When the user enters text in the cell he can click a term in the list and it will be appended to the text.

Any vba snippets or relevant links much appreciated
Thanks
David
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Sounds like using a userform with vbmodeless to popup the list. The user then can select from a listbox on the form and do as you desire.
 
Upvote 0
Thanks Roderick, My first ray of hope, going to give it a go, let you know.

David
 
Upvote 0
Ok! this opens up the listbox and I can continue entering text into the cell with the listbox open, now I'm trying to click an item in the list box and get it inserted at the cursor I've tried this:
Code:
Dim i As Long, r As Long, c As Long
r = ActiveCell.Row
c = ActiveCell.Column
With Me.ListBox1
  For i = 0 To .ListCount - 1
    If .Selected(i) = True Then Selection.InsertAfter .Column(r, c)
    Application.ScreenRefresh
    Exit Sub
  Next
End With

but nothing happens, any ideas?

Thanks David
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top