+ Reply to Thread
Results 1 to 8 of 8

Deletion of highlighted cells macro

  1. #1
    Registered User
    Join Date
    03-29-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    9

    Deletion of highlighted cells macro

    Hey guys,

    I've managed to solve the macro for finding duplicates in name list.
    But this time I'd like to have an additional macro for the deletion of those duplicates whose cells are highlighted.

    Can anyone help me with this?

    Thanks in advance!

    Previous macro solved:
    http://www.excelforum.com/excel-gene...name-list.html

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Deletion of highlighted cells macro

    Hi, bosetan,

    if the cells are highlighted (marked) it would be good enough to use
    Please Login or Register  to view this content.
    This will only delete the cells.

    If you want to delete the rows with the marked cells as well you could use
    Please Login or Register  to view this content.
    HTH,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    03-29-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Deletion of highlighted cells macro

    Hey HaHoBe,

    I've tried creating a new set of macro for just deleting the entire row that has the highlighted cells, using your macro.

    But it doesn't seems to work. Any idea what's wrong?

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Deletion of highlighted cells macro

    Hi, bosetan,

    But it doesn't seems to work.
    Any Error messages? Sheet protected? Workbook protected? Using my dearest enemies: merged cells? To be honest: no idea with that description.

    Maybe you could show the code and describe where you placed it?

    Ciao,
    Holger

  5. #5
    Registered User
    Join Date
    03-29-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Deletion of highlighted cells macro

    Hmmm....

    Okay. I first start off with creating a new macro, and pasted the macro you gave me into it.
    Lastly, assign the new macro to some shape.

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Deletion of highlighted cells macro

    Hi, bosetan,

    very good ratio on questions being asked and answers being given.

    Please Login or Register  to view this content.
    See attached workbook.

    Ciao,
    Holger
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-29-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Deletion of highlighted cells macro

    Hey man,

    Thanks a lot! It works perfectly now. Is it possible to just delete certain range of cells rather than the entire row?

  8. #8
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Deletion of highlighted cells macro

    Hi, bosetan,

    I think so - it depends on if you ever would like to indicate which range?

    You could get the information into the range object when building it - this example will delete the range from B to E and get the cells up to fill (not to the left):
    Please Login or Register  to view this content.
    Ciao,
    Holger

+ 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