find value and delete cell and the cell next to it

  • Thread starter Pierre via OfficeKB.com
  • Start date
P

Pierre via OfficeKB.com

Hi experts,

i have a combobox on a userform. The user selects a value.
Then i have to lookup the value in a range (zoekrange) and delete the cell
containing the value and the cell next to it. I tried resizing the zoekrange
but it did not work.
Here's my code so far...

Private Sub but_verwijder_Click()
Dim zoekrange As Range
Application.ScreenUpdating = False
Sheets("hulpblad").Select
Set zoekrange = Range("b2:c500").Find(cbo_accountnr.Value)
zoekrange.Resize(0, 1).Delete shift:=xlShiftUp
MsgBox "done"
Sheets("nieuwe productie 2006").Select
Application.ScreenUpdating = True
Unload Me
End Sub

any ideas please ?
thanks,
Pierre
 

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