View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Evaluating a Sting in VBA

dim col as long, lastrow as long, i as long
col = 1
lastrow = cells(rows.count,col).End(xlup)
for i = lastrow to 1 step -1
if instr(1,cells(i,col).value,"<",vbTextcompare) then
cells(i,col).EntireRow.Delete
end if
Next i

Change the value assigned to col to reflect the column to check.

--
Regards,
Tom Ogilvy


"Mike" wrote in message
...
Hello all,

I'm trying to write a code that will read the value of a cell as a string.
If the string in a cell does not begin with a "<" character, the row that

the
evaluated cell is in should be deleted.

I'm thinking I should using the "instr" code, but I can't seem to get it
working.

Any help would be greatly appreciated,

Mike