+ Reply to Thread
Results 1 to 8 of 8

How to remove characters from cells in excel vba

  1. #1
    Registered User
    Join Date
    08-06-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    11

    How to remove characters from cells in excel vba

    Hi,

    I was wondering, in the D and F column, how can I use vba to remove the "Day" which is in front of the numbers.
    I want to do this because I would like to compare these numbers but am unable to do so because they are not considered integers.
    Also, all these data in the excel attachment are all randomly generated, but I just extracted this small portion out.

    PS: New to excel vba
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: How to remove characters from cells in excel vba

    you don't need VBA, but simple text formulas

  3. #3
    Registered User
    Join Date
    08-06-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: How to remove characters from cells in excel vba

    Hmm, how do I add these formulas to the whole column? Assuming I know them

  4. #4
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: How to remove characters from cells in excel vba

    To be honest, the fastest way to do this is with a traditional REPLACE, no functions nor vba.

    Highlight the selection you want to remove data from, then press CTRL+H to bring up the REPLACE form. In the FIND WHAT box, enter Day (make sure to add a space after the word Day so that excel will clear that out to).

    In the REPLACE WITH box, leave it blank.

    Let me know if it helps

  5. #5
    Registered User
    Join Date
    08-06-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: How to remove characters from cells in excel vba

    Hey, thanks it works! But when the columns D and F data changes, the "Day" comes back. Is there a way to permanently filter out the "Day" word?

  6. #6
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: How to remove characters from cells in excel vba

    Where is the data coming from? How often does it change?

  7. #7
    Registered User
    Join Date
    08-06-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: How to remove characters from cells in excel vba

    It's coming from another spreadsheet in the same excel file. It changes only when I press a button

  8. #8
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: How to remove characters from cells in excel vba

    the best way is to remove day before It's coming

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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