+ Reply to Thread
Results 1 to 4 of 4

Improving text to column code to use a TRIM to cleanup further the results

  1. #1
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Improving text to column code to use a TRIM to cleanup further the results

    Hi,

    Am using the following code to split the text at line breaks into new rows:
    Please Login or Register  to view this content.
    Afterwards I use the following basic text to column code to split it as per my necessity:
    Please Login or Register  to view this content.
    The problem is that all the leading and trailing spaces are left in the cells. How can I improve it to trim the results and replace the blank cells in one column with a specific word?

    Many thanks in advance,
    Paul

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Improving text to column code to use a TRIM to cleanup further the results

    in one column with a specific word?
    Too vague. What column and word?


    Attach a sample workbook. 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.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Improving text to column code to use a TRIM to cleanup further the results

    This trims every value and replaces blanks in column B

    Please Login or Register  to view this content.

  4. #4
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Improving text to column code to use a TRIM to cleanup further the results

    Hi AlphaFrog,

    Thank you for your assistance and solution. I've managed to integrate it into my code. Problem resolved, you are awesome. Thanks again.

+ 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. VB Code to cleanup Wrap Text
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-23-2017, 07:17 AM
  2. [SOLVED] Need to trim various prefixed that are in ALL CAPS off of the front of text in a column
    By syncguy in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-31-2013, 03:58 PM
  3. [SOLVED] Like some ideas on improving code on long IF statement used in VBA code please
    By dawatcher in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-12-2013, 01:44 PM
  4. search and trim text in column
    By aarodn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-26-2013, 04:59 PM
  5. Improving code to hide Rows when user double clicks in column A
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2012, 02:10 AM
  6. Code Cleanup
    By KevBotes in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2012, 02:09 PM
  7. Code cleanup
    By timlocke in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-10-2011, 08:01 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