View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Phil Phil is offline
external usenet poster
 
Posts: 6
Default use vb to delete marked rows

Having trouble with this one, hope someone can help me with the code.
I have a sheet with rows 3-700 and columns A-J. I want to have some vb code
that when run(doing it on a click action for a button) deletes rows that I
have marked with an X in cell J3-J700. So if it sees a X in cell J3, it
highlights the entire row and deletes it, then move on to J4 and checks for
the X and so on. If there is no X then it should just move to the next one
and keep checking.
I can get it to sort of work with if/then statements, but one problem I'm
having is when you delete a row they all shift up, so just going to the next
row starts to "skip" rows that were moved up. And the other problem is how
to simplify the code for J3-J700 so I don't have to put 700 if/then
statements in. Thanks for any help.