+ Reply to Thread
Results 1 to 21 of 21

VBA to Delete Range Shift to xlToUp

  1. #1
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    VBA to Delete Range Shift to xlToUp

    hi, all
    i ask bout if is possible delete only specific range not whole row i have this code but gives me error run time error 1004 in my sheet i have data in column f shouldn't delete
    HTML Code: 
    Attached Files Attached Files
    Last edited by ABDELFATTA; 05-23-2020 at 11:29 AM.

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: VBA to Delete Range Shift to xlToUp

    It should be
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: VBA to Delete Range Shift to xlToUp

    hi, fluff i made a big mistake it should the post delete empty specific range what you suggest issue a new post ?

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: VBA to Delete Range Shift to xlToUp

    What is the specific range?

  5. #5
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: VBA to Delete Range Shift to xlToUp

    this range Range("B2:D10") it contains some data and some empty data so it supposes delete any empty cell in this range without effect in column f

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: VBA to Delete Range Shift to xlToUp

    Does the whole row have to be blank?

  7. #7
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: VBA to Delete Range Shift to xlToUp

    no just this is range because i fill some data after this range

  8. #8
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,519

    Re: VBA to Delete Range Shift to xlToUp

    Please Login or Register  to view this content.

  9. #9
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: VBA to Delete Range Shift to xlToUp

    Give it a try
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: VBA to Delete Range Shift to xlToUp

    hi, jolivanes it something wrong you can see my image
    Attachment 679194

  11. #11
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: VBA to Delete Range Shift to xlToUp

    hi, Vraag en actually your code doesn't work

  12. #12
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,519

    Re: VBA to Delete Range Shift to xlToUp

    No, we cannot.
    You have to go to the bottom and click on "Go Advanced" to attach a file.

  13. #13
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: VBA to Delete Range Shift to xlToUp

    What doesn't work on the code? Just shouting that it doesn't work gives little information.

  14. #14
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: VBA to Delete Range Shift to xlToUp

    here is the image
    Attached Images Attached Images

  15. #15
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: VBA to Delete Range Shift to xlToUp

    That is very special if this is in the example file.
    Attached Images Attached Images

  16. #16
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: VBA to Delete Range Shift to xlToUp

    Vraag en your code doesn't work at all it supposes delete row 3, 5

  17. #17
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,519

    Re: VBA to Delete Range Shift to xlToUp

    Like VenA mentioned, what are we to do with that picture. Probably tells you a story but not us.
    Attach a workbook with a before and after.

  18. #18
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,519

    Re: VBA to Delete Range Shift to xlToUp

    Please Login or Register  to view this content.

  19. #19
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: VBA to Delete Range Shift to xlToUp

    it supposes delete rows3,5 but your code doesn't work at all

  20. #20
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: VBA to Delete Range Shift to xlToUp

    thanks jolivanes awesome code

  21. #21
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,519

    Re: VBA to Delete Range Shift to xlToUp

    Glad you've got it solved.
    Eid Moubarak

+ 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. [SOLVED] Delete range in row and shift left based on old date
    By Apatheticnerd in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-23-2019, 04:17 PM
  2. [SOLVED] What is wrong with my syntax? Trying to delete variable range of cells and shift up....
    By bg18461 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-04-2015, 12:03 PM
  3. go through a range and delete, shift cells left if contain no data.
    By 13lack13lade in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2014, 09:50 PM
  4. [SOLVED] If criteria met: delete cell and shift to the left but shift only over a certain range
    By olivierpbeland in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-11-2013, 07:44 AM
  5. VBA Delete range and shift cells up
    By jbmerrel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2013, 06:14 PM
  6. Delete Range of Rows and Columns and Shift Up
    By BobBing in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-17-2012, 02:02 PM
  7. [SOLVED] How to delete a range and shift the rest up in Vbasic?
    By serdar in forum Excel General
    Replies: 8
    Last Post: 06-11-2005, 12:05 PM

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