Edit cell contents via userform listbox

  • Thread starter Thread starter N E Body
  • Start date Start date
N

N E Body

Many thanks for the code Dave

Yep sometimes I need to clear the cell! I have saved your code as i
will, no doubt, be usefull another time!

I am opting to put a messagebox in front of your other piece of code.
If I forewarn the user this should be enough protection!!! Anyway
they are the ones who have to type it back in <g>

Regards

Kenn
 
Maybe adjusting the first version:

Private Sub CommandButton2_Click()
If myCell Is Nothing Then
'do nothing
Else
myCell.Value = Me.TextBox1.Value
Me.TextBox1.Value = ""
Me.ListBox1.List = myRng.Value
End If
End Sub

to

Private Sub CommandButton2_Click()
If myCell Is Nothing Then
'do nothing
Else
myCell.Value = Me.TextBox1.Value
Me.TextBox1.Value = ""
Me.ListBox1.List = myRng.Value
'break it for the next click!
set mycell = nothing
End If
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

Back
Top