+ Reply to Thread
Results 1 to 28 of 28

How to delete cells and rows with specific Characters using VBA

  1. #1
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    How to delete cells and rows with specific Characters using VBA

    Hello all,

    How to delete cells staring with symbols using VBA? Excel needs to recognize cells content starting with symbols and delete it from huge bunch of data.

    Below I have given examples on how it looks like

    &l1O(8U(s0P(s12H(s0S &k9.55H&a1L&l5.25C&l3E

    ------------ ------------------ ------------------ -------------------- --- ------------ ------ ------------- ----------------------

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: How to delete cells and rows with specific Characters using VBA

    What does the valid data look like?
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

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

    Re: How to delete cells and rows with specific Characters using VBA

    Try
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: How to delete cells and rows with specific Characters using VBA

    Valid data starts with letters

  5. #5
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: How to delete cells and rows with specific Characters using VBA

    It works. But it didn't delete below dashes. Any suggestion to delete row of below dashes

    ------------ ------------------ ------------------ -------------------- --- ------------ ------ ------------- ----------------------

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

    Re: How to delete cells and rows with specific Characters using VBA

    You have to let us know which characters. In the first post you only mentioned one.
    How many and which ones do you need deleting?

  7. #7
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: How to delete cells and rows with specific Characters using VBA

    ------------ ------------------ ------------------ -------------------- --- ------------ ------ ------------- ----------------------

  8. #8
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: How to delete cells and rows with specific Characters using VBA

    I need to delete row of dashes

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: How to delete cells and rows with specific Characters using VBA

    Try this:

    Please Login or Register  to view this content.
    Last edited by xladept; 01-24-2019 at 02:50 PM.

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

    Re: How to delete cells and rows with specific Characters using VBA

    Or as in post #3 with another character added.
    Also deletes negative numerical values like -12345.
    Please Login or Register  to view this content.
    Last edited by jolivanes; 01-24-2019 at 03:20 PM.

  11. #11
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: How to delete cells and rows with specific Characters using VBA

    No It's deleting whole content. Let me explain clearly what i want to do

    I want to delete cell con

    &l1O(8U(s0P(s12H(s0S &k9.55H&a1L&l5.25C&l3E

    ?&l1O(8U(s0P(s12H(s0S &k9.55H&a1L&l5.25C&l3E - This has box with question mark at starting which I couldn't able to paste in here

    What to delete row containting below dashes

    ------------ ------------ ------------ ---- -------------- --- ---------- ------------------------ -------- ---------- -------------

    Want excel to find all cells which has PO Number and put a selection with current region and to do Text to columns delimited with respect to spaces

    I need to some support using macros since it is imported from Text file which is causing this kinds of issue
    2019-01-25 01-20-17 - Excel.png2019-01-25 01-21-22 - Excel.png

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

    Re: How to delete cells and rows with specific Characters using VBA

    Re: My post #6
    Just noticed now that the bottom of your first post is characters meant to be deleted. Not, as I initially thought, a way to spruce up your post.
    My apologies.

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

    Re: How to delete cells and rows with specific Characters using VBA

    Attach a Workbook which has all the data in it that needs deleting/changing.
    Mark, color the cells maybe, which cells or rows need clearing contents or deleting.
    A before and after sheet might work the best.

  14. #14
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: How to delete cells and rows with specific Characters using VBA

    Now try this:

    Please Login or Register  to view this content.

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

    Re: How to delete cells and rows with specific Characters using VBA

    @ xladept,

    Here you provide Code as a solution while you are using Tippex.

    Hi buddy.
    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] .

  16. #16
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: How to delete cells and rows with specific Characters using VBA

    Hi, initial code which you sent has cleared contents of &l1O(8U(s0P(s12H(s0S &k9.55H&a1L&l5.25C&l3E which i intented.

    But it left out below code mentioned in pic as well. Can you modify same code to clear contents of below please

    ?&l1O(8U(s0P(s12H(s0S &k9.55H&a1L&l5.25C&l3E - This has box with question mark at starting which I couldn't able to paste in here

  17. #17
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: How to delete cells and rows with specific Characters using VBA

    Its not working

  18. #18
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: How to delete cells and rows with specific Characters using VBA


  19. #19
    Forum Expert
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,513

    Re: How to delete cells and rows with specific Characters using VBA

    Perhab only text and number not simbol
    Please Login or Register  to view this content.
    "Presh Star Who has help you *For Add Reputation!! And mark case as Solve"

  20. #20
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: How to delete cells and rows with specific Characters using VBA

    If t1= "" then t1= t else t1=t1&t

    above line causing syntax error

  21. #21
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: How to delete cells and rows with specific Characters using VBA


  22. #22
    Forum Expert
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,513

    Re: How to delete cells and rows with specific Characters using VBA

    this code not allow if character is simbol then clearContents,change is needed
    Please Login or Register  to view this content.
    if you allow only little simbol then change this
    Please Login or Register  to view this content.
    Last edited by daboho; 01-25-2019 at 12:25 PM.

  23. #23
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: How to delete cells and rows with specific Characters using VBA

    No It deleted whole dataset

  24. #24
    Forum Expert
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,513

    Re: How to delete cells and rows with specific Characters using VBA

    can you give picture data will be to delete or not to delete
    if you keep litte simbol you can modifay
    Please Login or Register  to view this content.

  25. #25
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: How to delete cells and rows with specific Characters using VBA

    I want to delete cell if it's starts with symbols. Can you use conditions in VBA?

  26. #26
    Forum Expert
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,513

    Re: How to delete cells and rows with specific Characters using VBA

    IF only first character is simbol (not text or number)
    Please Login or Register  to view this content.

  27. #27
    Registered User
    Join Date
    01-24-2019
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    96

    Re: How to delete cells and rows with specific Characters using VBA

    Hi, it should delete only first character is symbol

    &l1O(8U(s0P(s12H(s0S &k9.55H&a1L&l5.25C&l3E

    It has deleted all cells which as symbols like Delivery:

    Need slight modification to delete cell only if first character is symbol

  28. #28
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: How to delete cells and rows with specific Characters using VBA

    Attach a sample workbook (not a picture or pasted copy). 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.

+ 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. Delete all rows with empty cells in a specific column
    By afridelle in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-17-2019, 03:14 PM
  2. [SOLVED] Delete NOT filtered Rows having non specific dates from a Column Cells
    By analystbank in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-22-2018, 08:31 AM
  3. [SOLVED] VBA to allow users to delete specific rows with locked cells on protected sheets
    By JT12345 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-13-2015, 02:46 PM
  4. [SOLVED] Delete specific characters from right side of string
    By Drudnits1 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-29-2014, 02:12 PM
  5. [SOLVED] If cell contains 3 or more specific characters then delete row
    By RichTea88 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-18-2014, 08:12 AM
  6. How to auto delete all the cells and rows at specific time ?
    By ryan4646 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-22-2013, 09:44 AM
  7. delete duplicate rows - looking at specific cells
    By wheelscpa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2008, 07:07 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