+ Reply to Thread
Results 1 to 6 of 6

Removing Certain characters from a cell value

  1. #1
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Removing Certain characters from a cell value

    I have a program that populates cells with the files it finds in a particular folder.

    While doing so, it copies the file extensions as well.

    I have a code that goes through each and tells the user what type of extension the file is. This is the code

    Please Login or Register  to view this content.
    What I need,
    • Instead of indicating the extenion, I want the code to remove the extension and copy just all characters except the file extensions.


    Example.
    if Range B4 was a0099A14.pdf, the code should populate just a0099A14 in cell.Offset(0, 2)
    • I tried using Right command but it returns the value. How can I get to remove everything what the Right command finds? As all extensions are 4 characters and are at the end of the filename
    Last edited by subbby; 11-29-2016 at 02:48 PM. Reason: Solved

  2. #2
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Re: Removing Certain characters from a cell value

    I am trying

    Please Login or Register  to view this content.
    gives an error message saying "object variable not specified"

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Removing Certain characters from a cell value

    I think you want Left, not Right:

    Please Login or Register  to view this content.
    Hope this helps.

    Pete

  4. #4
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Re: Removing Certain characters from a cell value

    Hello Pete,


    I tried

    Please Login or Register  to view this content.
    it is giving a type mismatch error

  5. #5
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Re: Removing Certain characters from a cell value

    Got it.. This worked ... I had to use the For Next statement to make it do for each row..

    Please Login or Register  to view this content.
    Thanks for the hint Pete. Appreciate your time.

    Reputation Star added

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Removing Certain characters from a cell value

    Glad to help - thanks for the rep.

    Pete

+ 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] Removing characters from a cell
    By SHUTTEHFACE in forum Excel General
    Replies: 5
    Last Post: 06-14-2016, 10:24 PM
  2. [SOLVED] removing characters from a cell
    By tdf2437 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-17-2014, 06:21 PM
  3. Excel 2007 : Removing characters in a cell
    By whofan in forum Excel General
    Replies: 24
    Last Post: 09-23-2011, 01:30 PM
  4. Removing characters from the end of a cell
    By KJW in forum Excel General
    Replies: 1
    Last Post: 05-20-2010, 08:39 AM
  5. Removing Characters from a cell
    By dmthomas8 in forum Excel General
    Replies: 2
    Last Post: 04-14-2010, 12:14 PM
  6. Removing first 3 characters of cell
    By yewkiang in forum Excel General
    Replies: 2
    Last Post: 12-17-2006, 11:49 PM
  7. [SOLVED] removing some of the characters from a cell
    By Patience in forum Excel General
    Replies: 2
    Last Post: 05-03-2005, 04:06 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