+ Reply to Thread
Results 1 to 13 of 13

Delete row that contains special character *

  1. #1
    Registered User
    Join Date
    02-05-2010
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    41

    Delete row that contains special character *

    I don't have much experience with macro and will appreciate your help.

    I need to delete the rows that contain special character * in the cell. This special character is in the first row.

    I have around 5000 rows and have attached test sample.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Delete row that contains special character *

    I do not see special character * on the attached. On the output part, you are deleting duplicating rows.

  3. #3
    Registered User
    Join Date
    02-05-2010
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Delete row that contains special character *

    I apologize for uploading wrong file. Here is the correct file uploaded.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Delete row that contains special character *

    I am not sure if your data are * plus T, but try this code

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-05-2010
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Delete row that contains special character *

    Thanks a lot. It worked perfect.

    Last question, I forgot to ask earlier. What will be new macro if i want to delete both *T or *V? Or let's say delete the row which contains cell starting with special character * (so that it can hanlde both *T and *V). I am ok with either one, whichever is easier to write in macro.
    Last edited by canada123; 04-16-2013 at 02:47 PM.

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Delete row that contains special character *

    Please Login or Register  to view this content.



  7. #7
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Delete row that contains special character *

    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Delete row that contains special character *

    Change this line
    Please Login or Register  to view this content.
    INTO

    Please Login or Register  to view this content.

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

    Re: Delete row that contains special character *

    Hello canada123,

    My 2 cents worth, please if I may?

    In the attached WorkBook, on Sheet 1, I am giving you 4 Buttons with Code: The one is to Clear the any "*, $ or &" from Column A regardless of where it may be positioned within any other Text or values. This just Clears it from Column And does not delete any Rows.

    The other Button is to Delete the Row where any "*, $ or &" may be in any Row of Column A regardless of where it may be positioned within any other Text or values.

    Another Button will delete all Rows regardless of where on the sheet any "*, $ or &", may present itself with of without any other values or Text.

    Click on the "Reset" button, to try it as many times as you like.

    Then take your pick, and just delete what you don't need.

    Hope it solves your issue.

    Also see the "Please consider" note at the bottom of this post.
    Attached Files Attached Files
    Last edited by Winon; 04-17-2013 at 06:36 AM. Reason: Improved on WorkBook Speed
    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] .

  10. #10
    Registered User
    Join Date
    02-05-2010
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    41

    Thumbs up (Solved) Delete row that contains special character *

    Thanks a lot to all three experts (Snb, AB33 and Winon). Everything worked perfect and well.

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

    Re: Delete row that contains special character *

    You are welcome!

    Hello canada123,


    Thank you for the nice Rep.

    If you feel that your issue has been resolved, then please do mark your Thread as "Solved".

    Happy Coding.

  12. #12
    Registered User
    Join Date
    02-05-2010
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Delete row that contains special character *

    Thanks Winon. I searched but could not find a way to insert SOLVED. Could you please advise how do i do it?

  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: Delete row that contains special character *

    Hi canada123,

    Go to the First Post of your Thread, and you will see in the Headings> Thread Tools (I think), but I am sure you'll find it. Select it, and Click on Solved.
    Last edited by Winon; 04-17-2013 at 12:26 PM. Reason: Spelling

+ 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