+ Reply to Thread
Results 1 to 17 of 17

How to make my macro delete rows? It currently hides the rows instead of deleting.

  1. #1
    Registered User
    Join Date
    05-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    How to make my macro delete rows? It currently hides the rows instead of deleting.

    Hey guys. I am new here, but hopefuly i will get some help.

    I currently use this macro below to hide blank rows:

    Please Login or Register  to view this content.

    Now that hides the rows, but I don't need them hidden i need to delete them because then it messes up my numbering on my sheet. It goes like 1 2 4 6 8 120 it depends what rows it deletes. I cant figure out how to do that.

    Any help is appreciated.
    Last edited by Majkataxmk; 05-18-2010 at 02:57 PM.

  2. #2
    Forum Contributor
    Join Date
    12-03-2009
    Location
    Providence RI
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    260

    Re: Need help with my current macro.

    Please put the code tags around your code, I'm sure someone will be glad to help once you do.

  3. #3
    Registered User
    Join Date
    05-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Need help with my current macro.

    Hi,

    That is my whole code i don't have anything else that's what i use.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Need help with my current macro.

    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.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Contributor
    Join Date
    12-03-2009
    Location
    Providence RI
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    260

    Re: I need my macro to delete rows not hide. Cant figure it out.

    thank you for fixing try replacing hide with delet

  6. #6
    Registered User
    Join Date
    05-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: I need my macro to delete rows not hide. Cant figure it out.

    What does that code do? I mean i added it at the end of my code, but not sure what it does.

    Please Login or Register  to view this content.

    Thanks!

  7. #7
    Forum Contributor
    Join Date
    12-03-2009
    Location
    Providence RI
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    260

    Re: I need my macro to delete rows not hide. Cant figure it out.

    i posted that in error. posting from my phone.
    replace:

    Please Login or Register  to view this content.
    with:
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    05-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: I need my macro to delete rows not hide. Cant figure it out.

    Quote Originally Posted by Dulanic View Post
    i posted that in error. posting from my phone.
    replace:

    Please Login or Register  to view this content.
    with:
    Please Login or Register  to view this content.
    Thanks for trying to help. When i do that I get a runtime error, and when i click debug on the error it takes me to that line where i changed it from hidden to delete .

  9. #9
    Forum Contributor
    Join Date
    12-03-2009
    Location
    Providence RI
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    260

    Re: I need my macro to delete rows not hide. Cant figure it out.

    did you remove the variable after? the =true needs to be removed. sorry i didnt clarify

  10. #10
    Registered User
    Join Date
    05-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: I need my macro to delete rows not hide. Cant figure it out.

    Hi,

    I did remove it and i tried to run the macro and it's deleting some rows god knows which ones and errors start popping up on my sheet.

  11. #11
    Forum Contributor
    Join Date
    12-03-2009
    Location
    Providence RI
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    260

    Re: I need my macro to delete rows not hide. Cant figure it out.

    Well, I am posting from my phone so i cant help with that right now. That is a problem with the rest of the macro. I figured that was a portion of the full code. I wont be able to help today but what do you want it to delete? The code you provided doesnt really specify which is why it may not be providing you the right results.

  12. #12
    Registered User
    Join Date
    05-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: I need my macro to delete rows not hide. Cant figure it out.

    For example I select Column B3 and I want it to delete all of the rows in it that do not have a number in them.

    Thanks

  13. #13
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: I need my macro to delete rows not hide. Cant figure it out.

    Once again!

    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.

    I'll be closing this post soon if you leave the title unchanged

  14. #14
    Registered User
    Join Date
    05-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: How to make my macro delete rows? It currently hides the rows instead of deleting

    I just changed it again.. Im not sure what can i change it to anymore

  15. #15
    Forum Contributor
    Join Date
    12-03-2009
    Location
    Providence RI
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    260

    Re: How to make my macro delete rows? It currently hides the rows instead of deleting

    You're not explaining the end result you want. Also, don't cross post and not say anything, it causes repeat work.

    FYI, if your macro worked but hide stuff, it will work the EXACT same way but delete the rows instead of hiding them with what I posted. So explain how it is different, and focus on ONE thread. You are wasting peoples time by cross posting.

    http://www.vbforums.com/showthread.php?p=3803169

    Rule 8: Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!
    Last edited by Dulanic; 05-18-2010 at 04:23 PM. Reason: Broke another rule, deleted my answer.

  16. #16
    Registered User
    Join Date
    09-21-2009
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: How to make my macro delete rows? It currently hides the rows instead of deleting

    Hi,

    Would you like me to send you the excel sheet itself so you can try it out and see? That should explain everything to you. Im sorry for posting on multiple forums, I am trying to get this sorted out ASAP.

    Thanks

  17. #17
    Registered User
    Join Date
    05-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: How to make my macro delete rows? It currently hides the rows instead of deleting

    I figured this out guys. I just record my own macro . Works just the way I need/want it to.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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