Results 1 to 2 of 2

Thread: Iterate through rows and delete non-numeric

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    2

    Iterate through rows and delete non-numeric

    Hi,

    I realise my last question was probably not specific enough.

    How do I iterate through every row in a worksheet without knowing how many rows there could be?

    Also how do I delete a whole row?


    Thanks,
    :Ant

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Iterate through rows and delete non-numeric

    Code:
    Rows(num).Delete
    or something like that - type it in and press f1 - should be some information on deleting.

    Either that or use a range/cell object...
    Code:
    sht.cells(1,1).DeleteRow
    Again look in the help files to clarify.

    Alternatively record a macro of you deleting a row and see what the code is.


    As to the how many rows. You could move up from the bottom to see when a key field (that is always filled) in your data is and grab the row number.
    Code:
    debug.print sht.cells(65535,1).end(xlup).row
    Hope that gives you some ideas.

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width