View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_7_] Bob Phillips[_7_] is offline
external usenet poster
 
Posts: 1,120
Default Help me in writing macro

Kishore,

Try this mod

Sub DeleteData()
Dim iLastRow As Long
Dim iRow1 As Long
Dim iRow2 As Long
Dim i As Long

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

End Sub



--
HTH

Bob Phillips

"kishore" wrote in message
oups.com...
Hi Bob,
Thanks for quick reply, but somehow I am unable to make it work, here
are my enteries, Is it possible to remove all the rows for which col C
dont have the values. This is how my sheets has the values.
Col A Col B Col C Col D Col E
ColF.......

05ID2862P1050 V31910 A08910 3211 3385 222 396 09/05/2005
05ID2862P1050 V31911 A08911 3386 3560 397 571 09/05/2005
05ID2862P1050 V31912 A08912 3561 3735 572 746 09/05/2005
05ID2862P1050 V31913 A08913 3736 3850 747 854 09/05/2005
05ID2214P1001 V31914 3607 3545 118 180 30/04/2005
05ID2214P1001 V31915 3544 3370 181 355 30/04/2005
05ID2214P1001 V31916 3369 3195 356 530 30/04/2005

And What I want to remove aal the rows for which there is no entry in
Col C, I can do it manually but.....
Many Thanks,
P.S - How to learn more abt Macro....any advice...Pls

Regds,
Kishore