Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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

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
Deleting the text without deleting the formula gems04 Excel Worksheet Functions 3 January 30th 09 11:21 PM
Deleting cell data without deleting formula Tom Hall Excel Discussion (Misc queries) 4 October 29th 06 04:07 PM
deleting values in a worksheet without deleting the formulas patti Excel Worksheet Functions 1 October 28th 05 09:49 PM
how prevent formula in cell from deleting when deleting value???? sh-boom New Users to Excel 1 September 30th 05 06:12 PM
Deleting Hyphens or Dashes from multiple cells without deleting the remaining content rmaloy Excel Programming 5 February 9th 04 01:59 AM


All times are GMT +1. The time now is 07:51 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"