+ Reply to Thread
Results 1 to 9 of 9

Simple help needed urgently!!

  1. #1
    Registered User
    Join Date
    09-21-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Simple help needed urgently!!

    hello.

    I'm trying to delete rows in an excel spreadsheet. I want a macro that will look at the first column in the spreadsheet (its a date column) and if the field is blank, it will delete the entire row and move onto the next row, Else it will leave it there. I have no clue how to do this but its pretty urgent.

    Thanks.

  2. #2
    Registered User
    Join Date
    09-21-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Simple help needed urgently!!

    I'm also using excel 2007

  3. #3
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Simple help needed urgently!!

    You need to give your thread a more descriptive title, while you think of one try...

    Please Login or Register  to view this content.

    Edited to add: SAVE YOUR WORK - before running this macro!
    Last edited by Andrew-R; 09-21-2010 at 11:55 AM. Reason: Panic!

  4. #4
    Registered User
    Join Date
    09-21-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Simple help needed urgently!!

    Quote Originally Posted by Andrew-R View Post
    You need to give your thread a more descriptive title, while you think of one try...

    Please Login or Register  to view this content.

    Edited to add: SAVE YOUR WORK - before running this macro!
    Thanks but I'm getting a run time error. It says 'application-defined or object defined error' or Runtime error 1004. After clicking debug it has highlighted

    'LastRow=ActiveSheet.Cells(ActiveSheet.Rows.Count,1).End(xlUp).Row'

  5. #5
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Simple help needed urgently!!

    Strange, it's working fine for me in Excel 2007.

    You are running it with the sheet you want cleaning active, aren't you?

    PS You still need to change your title, "Deleting rows which are blank", or similar.

  6. #6
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Simple help needed urgently!!

    Looking at the line:

    Please Login or Register  to view this content.
    it seem to that there is no space between "LastRow=" and "=ActiveSheet"
    i.e. it should read "LastRow = ActiveSheet"

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,040

    Re: Simple help needed urgently!!

    Hi readingr,

    wellcome to the forum but please check rules how to name a thread:


    1. Use concise, accurate thread titles. Your post title should describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change the title of the thread, click EDIT on the original post, then click the Go Advanced button, then change the title. If two or more hours have passed, the EDIT button will not appear, and you need to ask a moderator to change the title.
    Never use Merged Cells in Excel

  8. #8
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Simple help needed urgently!!

    Quote Originally Posted by Alf View Post
    it seem to that there is no space between "LastRow=" and "=ActiveSheet"
    i.e. it should read "LastRow = ActiveSheet"
    Shouldn't make a difference. I cut my code from my first reply and pasted it straight into a new workbook and it worked fine.

  9. #9
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: Simple help needed urgently!!

    Since subtle hints don't work... ()

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    PLEASE PM WHEN YOU HAVE DONE THIS AND I WILL DELETE THIS POST
    Everyone who confuses correlation and causation ends up dead.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1