+ Reply to Thread
Results 1 to 5 of 5

I am trying to truncate cells in a column from a specific character in a string

  1. #1
    Registered User
    Join Date
    10-25-2011
    Location
    Des Moines, Iowa
    MS-Off Ver
    Excel 2007
    Posts
    18

    Question I am trying to truncate cells in a column from a specific character in a string

    I have a macro coded to create a new sheet, copy from the first sheet, and paste in specific format to the newly created sheet2. My problem is I cannot get column C to truncate at the end of each cell's string; being "..D" or "...D*". Every cell in column C ends in either "D" or "D*" and I need this removed. Any assistance would be helpful.

    Code I am currently working with is shown below. I would like to insert the needed code after

    CopyPaste_Sheet2.Hide
    ActiveWorkbook.Sheets(2).Activate


    Please Login or Register  to view this content.
    Thanks for looking at my frustrations.

    J.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,571

    Re: I am trying to truncate cells in a column from a specific character in a string

    All of the data in the sample column C is the same length so:
    Please Login or Register  to view this content.
    If that's not the case, then find the "D" and move left by 1:
    Please Login or Register  to view this content.
    Ben Van Johnson

  3. #3
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: I am trying to truncate cells in a column from a specific character in a string

    or

    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,571

    Re: I am trying to truncate cells in a column from a specific character in a string

    There's a space betwee D and *

  5. #5
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: I am trying to truncate cells in a column from a specific character in a string

    with .find function in VBA, * works as wildcard, which removes letter D and every letter after the D

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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