Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default I need a macro to delete unwanted data


Bob Phillips wrote:
Dim iLastRow As Long
Dim i As Long

iLastRow = Cells(Rows.Count,"C").End(xlUp).Row
For i = iLastRow to 1 Step -1
If Cells(i,"C").Value = "y" Then
Cells(I,"C").Entirerow.Delete
End If
Next i

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jason" wrote in message
om...
Hi all,

I need to design a macro in Excel that will delete all unwanted

data.
For example: I have fields a,b,c,d. In field c my data is either
x,y,z. If data is y then I want to delete the entire row.

Thanks


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
Delete unwanted data JJ Excel Worksheet Functions 1 February 26th 08 08:14 AM
macro to delete unwanted data pm Excel Discussion (Misc queries) 2 May 2nd 07 06:50 PM
Macro to delete unwanted sheets Sal Excel Discussion (Misc queries) 5 March 15th 07 09:33 PM
Delete Unwanted Data Happy Excel Discussion (Misc queries) 1 August 17th 05 06:20 AM


All times are GMT +1. The time now is 07:05 PM.

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"