+ Reply to Thread
Results 1 to 17 of 17

vba excel help delete entire row

  1. #1
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    vba excel help delete entire row

    Can someone tell me why it keeps throwing an error on this?
    Please Login or Register  to view this content.
    How can I accomplish this without selecting or activating? Any help??
    Please Login or Register  to view this content.
    Last edited by terriertrip; 01-24-2018 at 08:07 PM.

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: vba excel help delete entire row

    This isn't correct.
    Please Login or Register  to view this content.
    needs to be
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: vba excel help delete entire row

    Hello terriertrip,

    As alternative, you could use only:

    Please Login or Register  to view this content.
    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    Re: vba excel help delete entire row

    Oh yeah, but that didn't seem to fix it. Is there a much more simple way to write this without having to use select. I recorded this from a macro to since the xlDown and the xlToRight is what I'm after, but not sure how that would be coded.

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: vba excel help delete entire row

    Hello terriertrip,

    How about this then,

    Please Login or Register  to view this content.
    Regards.

  6. #6
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    Re: vba excel help delete entire row

    I think this is close Winon. Thank you. The deletion from row 55 needs to somehow incorporate the End.xlDown so I can delete a range of data below 55.

  7. #7
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: vba excel help delete entire row

    Thank you for the feedback, terriertrip,

    ...xlDown so I can delete a range of data below 55
    You don't say how far down, would it be all the way?

    A sample workbook would be of great help.

    Make sure there is just enough data to demonstrate your need.

    Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.

    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

    Regards.

  8. #8
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    Re: vba excel help delete entire row

    I will attach a sample if this is not clarification enough. It is only to the last cell used within Col A.

  9. #9
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    Re: vba excel help delete entire row

    Thank you for your help Winon. It looks like I've got it. Here is the completed code:
    Please Login or Register  to view this content.
    Last edited by terriertrip; 01-24-2018 at 08:51 PM. Reason: edit code

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: vba excel help delete entire row

    How about this then.
    Please Login or Register  to view this content.
    Last edited by bakerman2; 01-24-2018 at 09:14 PM.

  11. #11
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    Re: vba excel help delete entire row

    Thank you bakerman2

  12. #12
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: vba excel help delete entire row

    This will also work, terriertrip,


    Please Login or Register  to view this content.
    Regards.

  13. #13
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: vba excel help delete entire row

    Sorry terriertrip,

    What I wanted to say was that this code could be applied to any sheet.

    Please Login or Register  to view this content.
    Regards.

  14. #14
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: vba excel help delete entire row

    Post duplicated, and was removed.

  15. #15
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: vba excel help delete entire row

    You're welcome and thanks for rep+.

  16. #16
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    Re: vba excel help delete entire row

    Thanks Winon. Much appreciated.

  17. #17
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: vba excel help delete entire row

    Hello terriertrip,

    You are welcome, glad I could assist in some way. Also, thank you for the Rep. I appreciate it!

    Regards.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. iCell.EntireRow.Delete not working. Need code to Delete Entire Row
    By unit285 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 05-27-2017, 10:48 PM
  2. [SOLVED] Macro Needed to Delete Entire Row if the Entire Row (Or Col A,B,C,D in row ) are blank
    By swade730 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-04-2016, 06:32 AM
  3. VBA code to delete the FILTERED range and moving the cell up (dont Delete entire row)
    By mchilapur in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-14-2015, 07:48 AM
  4. Replies: 2
    Last Post: 03-23-2014, 07:22 AM
  5. [SOLVED] Delete cell only with certain critria. Don't want to delete entire row, the celsl only
    By RobertOHare in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-16-2013, 04:18 AM
  6. Delete an entire folders contents (or just Excel files)
    By DejaVu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-07-2006, 04:29 PM
  7. [SOLVED] How do I delete duplicate records from an entire Excel workbook?
    By Steven B. in forum Excel General
    Replies: 0
    Last Post: 12-06-2005, 06:35 AM

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