ListView selection

A

avi

Hello,

How do I allow a user to selrct the content of a ListView and copy it
by a RightClick

Thanks
Avi
 
J

JLGWhiz

ListView is not a built in function of VBA. You would have to construct the
list in Excel and then develop the controls and code for a user to display it
by clicking a button or using a keyboard command key.
 
L

Leith Ross

ListView is not a built in function of VBA. You would have to construct the
list in Excel and then develop the controls and code for a user to display it
by clicking a button or using a keyboard command key.

Hello Avi,

Here is a sample of List View I used in VBA. My UserForm had a
ListView and 3 TextBoxes. This is taken from the Click event...

Private Sub ListView1_ItemClick(ByVal item As MSComctlLib.ListItem)

Dim RowNumber

RowNumber = item.Index

With ListView1.ListItems(RowNumber)
TextBox1.Text = .Text
TextBox2.Text = .SubItems(1)
TextBox3.Text = .SubItems(2)
.EnsureVisible
End With

End Sub

The Text property returns the item in the first column. Each
additional column is designated by the SubItems property. To JLGWhiz -
the ListView control can be added by going to "Additional Controls..."
under Tools menu in the VBIDE. You must have a UserForm in your
project selected and the control toolbox visible to access these
controls.

Sincerely,
Leith Ross
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top