LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
ina ina is offline
external usenet poster
 
Posts: 120
Default Delete row problem, could some help me on that?

Hello guys,

I have a problem with this small sub, I would like to delete the row it
the value of one cell is egual of the value of cell + 1 but I have this
problem delete method of range class failed and I do not know why?

Sub deletequalrow()
Dim LastRow As Long
Dim i As Long


With ActiveSheet.UsedRange
LastRow = .Cells(.Cells.Count).Row
End With


For i = LastRow To 1 Step -1
If Cells(i, "B").Value = Cells(i - 1, "B").Value Then
Rows(i).EntireRow.Delete
End If
Next i
End Sub

Ina

 
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
Problem of selection.delete Radhakrishna k.v.n.r[_2_] Excel Worksheet Functions 7 October 27th 07 11:50 AM
Problem Using Delete Key Because of Combobox Joseph Fletcher Excel Discussion (Misc queries) 11 February 23rd 07 01:45 PM
Delete problem Loi New Users to Excel 3 December 8th 04 01:35 AM
Delete Sheets Problem Edgar Thoemmes[_4_] Excel Programming 3 October 27th 04 12:32 PM
Name Delete Problem Again Meme Excel Programming 1 April 9th 04 03:31 AM


All times are GMT +1. The time now is 07:27 AM.

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

About Us

"It's about Microsoft Excel"