ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   deleting row (https://www.excelbanter.com/excel-programming/385589-deleting-row.html)

John via OfficeKB.com

deleting row
 
My macro doesn't seem to do anything could I have some input?

Dim lastrow As Long, i As Long
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
For i = lastrow To 1 Step -1
If LCase(Cells(i,"Q").Value) = "Closed" Then
Rows(i).Delete
End If
Next
End Sub

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200703/1


Ron de Bruin

deleting row
 
Hi John

If LCase(Cells(i,"Q").Value) = "Closed" Then


change to

If LCase(Cells(i,"Q").Value) = "closed" Then



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"John via OfficeKB.com" <u27679@uwe wrote in message news:6f6bb073be44c@uwe...
My macro doesn't seem to do anything could I have some input?

Dim lastrow As Long, i As Long
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
For i = lastrow To 1 Step -1
If LCase(Cells(i,"Q").Value) = "Closed" Then
Rows(i).Delete
End If
Next
End Sub

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200703/1


John via OfficeKB.com

deleting row
 
I tried uppercase and lower case but still nothing it just...does absolutly
nothing lol

Ron de Bruin wrote:
Hi John

If LCase(Cells(i,"Q").Value) = "Closed" Then


change to

If LCase(Cells(i,"Q").Value) = "closed" Then


My macro doesn't seem to do anything could I have some input?

[quoted text clipped - 6 lines]
Next
End Sub


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


Ron de Bruin

deleting row
 
Hi John

Are you sure that column A have data ?
Maybe there are spaces in the cell, the value is maybe " Closed" ?

See this page for examples
http://www.rondebruin.nl/delete.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"John via OfficeKB.com" <u27679@uwe wrote in message news:6f6bb073be44c@uwe...
My macro doesn't seem to do anything could I have some input?

Dim lastrow As Long, i As Long
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
For i = lastrow To 1 Step -1
If LCase(Cells(i,"Q").Value) = "Closed" Then
Rows(i).Delete
End If
Next
End Sub

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200703/1



All times are GMT +1. The time now is 11:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com