+ Reply to Thread
Results 1 to 17 of 17

how can i remove a cell value if the cell value starts with space

  1. #1
    Forum Contributor
    Join Date
    04-06-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    193

    Post how can i remove a cell value if the cell value starts with space

    how can i remove a cell value(string) if the cell value starts with space
    requred vba code
    Last edited by anilg0001; 09-16-2014 at 02:47 AM.

  2. #2
    Forum Contributor
    Join Date
    04-06-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    193

    Re: how can i remove a cell value(text) if the cell value starts with space

    Re: how can i remove a cell value(text) if the cell value starts with space
    Last edited by anilg0001; 09-16-2014 at 02:48 AM. Reason: change required

  3. #3
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: how can i remove a cell value(text) if the cell value starts with space

    Hi Anil,

    You can use the below code and hope this is what you want:

    Please Login or Register  to view this content.
    Note: Instead of cell A1, use can also enter range value.


    Regards,
    Paresh J
    Click on "* Add Reputation" as a way to say thanks

  4. #4
    Forum Contributor
    Join Date
    04-06-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    193

    Re: how can i remove a cell value(text) if the cell value starts with space

    thanks Pareshj

    when i do that it will clear what ever the value in a1 cell

    actually i need

    if my A1 range has a string which start with space then i need to delete that cell value

    eg
    if " anil" need to delete
    if "anil" not to delete

  5. #5
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: how can i remove a cell value(text) if the cell value starts with space

    Hi Anil,

    Check the below code and hope this will help you:

    Please Login or Register  to view this content.

    Note: Please change Sheet1 and Range as per your requirement.


    Regards,
    Paresh J

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

    Re: how can i remove a cell value if the cell value starts with space

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    04-06-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    193

    Re: how can i remove a cell value(text) if the cell value starts with space

    thanks paresh j
    i tried ur code but nothing was happening
    these are the examples of a range

    DEI Black Exhaust Wrap
    XDP Price: From $25.78 to $75.38
    rating
    Universal - All Makes & Models
    DEI Cell Saver - Battery Insulation Kit 010480
    DEI Cell Saver - Battery Insulation Kit 010480
    List Price: $23.97
    XDP Price: $17.98
    You Save: $5.99 (25 %)
    Universal - All Makes & Models
    DEI Cool Cover Air Tube Cover Kit 010417
    DEI Cool Cover Air Tube Cover Kit 010417

    here A5 and A11 texts are starting with space which i need to be blank
    please review

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,276

    Re: how can i remove a cell value if the cell value starts with space

    For column A, simply:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  9. #9
    Forum Contributor satputenandkumar0's Avatar
    Join Date
    11-08-2012
    Location
    Pune, India
    MS-Off Ver
    Office xp & Office 2007
    Posts
    398

    Re: how can i remove a cell value if the cell value starts with space

    or

    Please Login or Register  to view this content.
    Regards,
    Nandkumar S.
    ---------------------------------------------------------------
    Don't forget to Click on * if you like my solution.

  10. #10
    Registered User
    Join Date
    09-09-2014
    Location
    Pune, India
    MS-Off Ver
    2010
    Posts
    18

    Re: how can i remove a cell value if the cell value starts with space

    Hi Anil,
    Are you try space find replace ?

  11. #11
    Forum Contributor
    Join Date
    04-06-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    193

    Re: how can i remove a cell value if the cell value starts with space

    thanks rishiraj46
    i tried both

    range("A:A").Replace " *", "", xlwhole

    Sub anilg0001()
    Columns(1).Replace " *", ""
    End Sub

    but no results

  12. #12
    Forum Contributor
    Join Date
    04-06-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    193

    Re: how can i remove a cell value if the cell value starts with space

    thanks mr.AB33

    which is not working

  13. #13
    Forum Contributor
    Join Date
    04-06-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    193

    Re: how can i remove a cell value if the cell value starts with space

    hello AB33
    ur code is correct but i do not need to delete the row i need that cell value=""

    thanks

  14. #14
    Forum Contributor
    Join Date
    04-06-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    193

    Re: how can i remove a cell value if the cell value starts with space

    hello AB33

    thanks dear i change it

    thanks for spending ur valuable time

  15. #15
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: how can i remove a cell value if the cell value starts with space

    Maybe:

    Please Login or Register  to view this content.

  16. #16
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,276

    Re: how can i remove a cell value if the cell value starts with space

    Quote Originally Posted by anilg0001 View Post
    i tried both

    range("A:A").Replace " *", "", xlwhole

    Sub anilg0001()
    Columns(1).Replace " *", ""
    End Sub

    but no results
    Then either the data isn't in column A, or the first character is not a space.

  17. #17
    Registered User
    Join Date
    09-09-2014
    Location
    Pune, India
    MS-Off Ver
    2010
    Posts
    18

    Re: how can i remove a cell value if the cell value starts with space

    Hi Anil
    Try this
    Find what: alt+0010
    OR alt+0013

    Replace with: Black

    find replace.png

+ 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] If Cell Starts with a Space, remove that space
    By Ocean Zhang in forum Excel General
    Replies: 2
    Last Post: 09-29-2012, 01:52 PM
  2. How to remove Space in a cell?
    By WillowD in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 03-13-2011, 05:11 AM
  3. remove blank space in cell?
    By gunsmokegirl in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-01-2008, 02:26 PM
  4. How to remove Empty Space in the Cell
    By ramki in forum Excel General
    Replies: 2
    Last Post: 06-27-2008, 04:27 AM
  5. Remove Space From Cell
    By rishi in forum Excel General
    Replies: 5
    Last Post: 05-27-2008, 09:00 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