+ Reply to Thread
Results 1 to 8 of 8

Adding a character to column if column doesn't already end in same character

  1. #1
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Adding a character to column if column doesn't already end in same character

    Column B is file path. In order for our system to recognize this they must end in a /. However if you just copy the file path then it won't end in the /, meaning that employees have to manually go in and add that. Super minor i know, but we have several people doing this for hundreds of documents a day. It adds up. How can I do a test that says if in column B the cell doesn't end in a /, then add one?


    I can't just do it to all of B because this worksheet is updated throughout the day and therefore rows 1-100 may already have the / but rows 101-150 do not. The file paths aren't the same either.

    Attached is a workbook in case it helps anyone. Just really,

    If doesn't end in "/" then add "/", Else nothing, apply to the last used row.

    Playing with this, but this doesn't go down the column either

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by taylorsm; 02-08-2018 at 06:23 PM.

  2. #2
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Re: Adding a character to column if column doesn't already end in same character

    Something similar to i think? But I am getting an object error

    Please Login or Register  to view this content.

  3. #3
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Adding a character to column if column doesn't already end in same character

    Try this:
    Please Login or Register  to view this content.
    Last edited by leelnich; 02-08-2018 at 06:50 PM.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  4. #4
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Re: Adding a character to column if column doesn't already end in same character

    Thanks! but damn, i was trying so hard to figure it out but I kept getting object errors and have no idea why. I like how yours doesn't just stop, if row 5 is missing it and row 50, then it will get them both. That is great!

  5. #5
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Adding a character to column if column doesn't already end in same character

    Please Login or Register  to view this content.
    "Master" is the Sheet name. but you used the syntax for a sheet's codename ("Sheet1" in this case). So either:
    Please Login or Register  to view this content.
    ...or:
    Please Login or Register  to view this content.
    Last edited by leelnich; 02-08-2018 at 07:45 PM.

  6. #6
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Adding a character to column if column doesn't already end in same character

    Glad I could help! If that concludes your thread, please remember to mark it as SOLVED (Thread Tools above post #1). Regards - Lee

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,518

    Re: Adding a character to column if column doesn't already end in same character

    Quote Originally Posted by taylorsm View Post
    Something similar to i think? But I am getting an object error

    Please Login or Register  to view this content.
    Like this
    Please Login or Register  to view this content.

  8. #8
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Adding a character to column if column doesn't already end in same character

    Quote Originally Posted by jindon View Post
    Please Login or Register  to view this content.
    Worksheet.Evaluate vs. Application.Evaluate...VERY COOL! Unqualified references are an issue with the latter, nice to know there's a "friendlier" version. AND it's apparently faster, too. Thanks for showing me something new. - Lee
    Last edited by leelnich; 02-09-2018 at 10:35 PM.

+ 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] Replace cell in Column A with value in Column B if contains similar character string
    By oybombadil in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-17-2015, 08:49 AM
  2. [SOLVED] if a string doesn't contain a character insert that character.
    By LenaK in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 01-31-2015, 12:54 PM
  3. Adding a character before certain words in a column
    By martinelli95 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-10-2014, 11:16 AM
  4. Replies: 3
    Last Post: 11-08-2012, 05:01 PM
  5. Replies: 7
    Last Post: 02-15-2012, 05:58 AM
  6. Replies: 6
    Last Post: 05-24-2011, 07:16 AM
  7. Replies: 4
    Last Post: 01-21-2011, 08:44 AM

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