Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default find value and delete cell and the cell next to it

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

--
Message posted via http://www.officekb.com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default find value and delete cell and the cell next to it

Try

zoekrange.Resize(1, 2).Delete shift:=xlShiftUp

"Pierre via OfficeKB.com" wrote:

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

--
Message posted via http://www.officekb.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default find value and delete cell and the cell next to it

Thanks Topper, this works fine !
Pierre

Toppers wrote:
Try

zoekrange.Resize(1, 2).Delete shift:=xlShiftUp

Hi experts,

[quoted text clipped - 19 lines]
thanks,
Pierre


--
Message posted via http://www.officekb.com
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
find cell that contains text and delete entre row Cristi R Excel Discussion (Misc queries) 3 August 2nd 06 04:32 PM
FIND THE CALCULATED VALUE OF A CELL AND DELETE IT FROM ANOTHER dcozzi Excel Discussion (Misc queries) 2 April 18th 06 07:06 PM
Find cell select row and delete Rich[_20_] Excel Programming 3 February 1st 04 03:06 PM
Find a cell then delete the row Ron de Bruin Excel Programming 0 July 28th 03 05:01 PM
Find a cell then delete the row Bob Phillips[_5_] Excel Programming 0 July 28th 03 04:52 PM


All times are GMT +1. The time now is 06:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"