View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
DKY[_14_] DKY[_14_] is offline
external usenet poster
 
Posts: 1
Default sorting code problems


Okay, here goes. The only reason I wanted to sort was so I could delet
the rows that have any other number besides 26 in column C. So, I foun
this code on the site and am currently trying to make it so that i
looks in Column C, and if there's anything besides the number 26 i
that column, it deletes the row. Then when its finished it hide
column C.

Dim rng as Range, sStr as String, i as Long
set rng = cells(1,"IV").End(xltoLeft)
for i = rng.column to 1 step -1
sStr = lcase(cells(1,i).Value)
if sStr < "first name" and _
sStr < "surname" and _
sStr < "score" then
cells(1,i).EntireColumn.Delete
end if
Nex

--
DK
-----------------------------------------------------------------------
DKY's Profile: http://www.excelforum.com/member.php...fo&userid=1451
View this thread: http://www.excelforum.com/showthread.php?threadid=26315