Listbox to change value in cell

J

Jeremy

I have a listbox with 3 columns going (1, 2, 3). Feeding this listbox is a
sheet with three columns (A,B,C).

What I am trying to do is when the user clicks on a button, the value that
is currently selected in listbox column 3 is looked up on the sheet in Column
C and the value next to it, Column B is changed to "yes"...which would then
change the listbox column 2 to "yes"

I know I need to do an offset, but having a hard time getting started, I
appreciate anyone's help.
 
P

Patrick Molloy

try this

Private Sub CommandButton1_Click()

If ListBox1.ListIndex < 0 Then Exit Sub

With Worksheets("Sheet2").Range("A6")
.Offset(ListBox1.ListIndex, 1) = "yes"
End With

End Sub
 

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

Top