+ Reply to Thread
Results 1 to 6 of 6

Using vba to remove characters in columns

  1. #1
    Forum Contributor
    Join Date
    09-08-2011
    Location
    Leicester, England
    MS-Off Ver
    Excel 2007
    Posts
    157

    Using vba to remove characters in columns

    test.xls

    Within this attachment I have three date columns in particular. Within those three date columns I need to remove the first 4 characters in each cell so I can then put the dd/mm/yy hh:mm format onto it.

    What I'm struggling with is telling it to remove the leading 4 characters in cell N,O,P

    Wed Oct 5 14:37:20 2011
    Mon Oct 17 09:12:15 2011
    Fri Oct 14 15:24:03 2011

    I need to become

    Oct 5 14:37:20 2011
    Oct 17 09:12:15 2011
    Oct 14 15:24:03 2011

    the range can vary so putting a loop into the range so it goes down the column until it reaches last one with something like what ive listed below then telling it to remove first 4 characters in those cells without having any background formulas on the excel sheet.


    Please Login or Register  to view this content.

    Thanks K

  2. #2
    Forum Contributor PingPing's Avatar
    Join Date
    02-19-2010
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    158

    Re: Using vba to remove characters in columns

    Use the Mid function.

  3. #3
    Forum Contributor
    Join Date
    09-08-2011
    Location
    Leicester, England
    MS-Off Ver
    Excel 2007
    Posts
    157

    Re: Using vba to remove characters in columns

    I cant run an application.worksheetfunction then would be:

    =MID(AD2,4,25)
    to show me my desired results. any thoughts?

  4. #4
    Forum Contributor PingPing's Avatar
    Join Date
    02-19-2010
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    158

    Re: Using vba to remove characters in columns

    VBA has its own Mid function. You don't need to call the worksheetfunction.

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Using vba to remove characters in columns

    hi kieranbop, option to make it, please check attachment, run code "test"
    Attached Files Attached Files
    Last edited by watersev; 04-19-2012 at 06:54 AM.

  6. #6
    Forum Contributor
    Join Date
    09-08-2011
    Location
    Leicester, England
    MS-Off Ver
    Excel 2007
    Posts
    157

    Re: Using vba to remove characters in columns

    sorry for the late reply, exactly what I'm after watersev, thanks very much

+ 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