Results 1 to 8 of 8

Using vba -how do I remove characters from right of space on all cells in specific columns

Threaded View

gbegnell Using vba -how do I remove... 06-08-2021, 09:46 PM
alansidman Re: Using vba -how do I... 06-08-2021, 10:31 PM
gbegnell Re: Using vba -how do I... 06-08-2021, 10:33 PM
vcoolio Re: Using vba -how do I... 06-08-2021, 10:40 PM
gbegnell Re: Using vba -how do I... 06-08-2021, 11:49 PM
jindon Re: Using vba -how do I... 06-08-2021, 11:10 PM
gbegnell Re: Using vba -how do I... 06-08-2021, 11:48 PM
jindon Re: Using vba -how do I... 06-08-2021, 11:53 PM
  1. #1
    Registered User
    Join Date
    06-08-2021
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    4

    Using vba -how do I remove characters from right of space on all cells in specific columns

    Sorry if this is a stupid question, but I am new to vba and I am trying to remove characters from the right of a space

    an example of the text in the cell is - 5/08/2015 at 12:22 PM

    I want to reduce it to 5/08/2015 (formatted as d/mm/yyyy)

    Dim tmp As String
    Dim DateOnly As String
    tmp = Range("E3").Value
    DateOnly = Left(tmp, InStr(tmp, " ") - 1)
    Range("E3").Value = CDate(DateOnly)
    this removes the time from the end of the one cell, but I am struggling to get it to work on all cells within 3 columns ("E:G")

    Can anyone assist please?
    Last edited by gbegnell; 06-08-2021 at 11:28 PM. Reason: copy of file attached

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to remove first 8 characters (including space) in a string
    By bala04msw in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-05-2021, 06:53 AM
  2. [SOLVED] Create a formula to remove last two characters from a cell if the 2nd character is a space
    By SellMeTv2 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-28-2019, 11:13 PM
  3. Remove all characters before space in line
    By gartie in forum Excel General
    Replies: 9
    Last Post: 08-29-2012, 05:52 PM
  4. [SOLVED] Trim Specific Values and Remove last right space
    By jantonio in forum Excel General
    Replies: 3
    Last Post: 05-02-2012, 08:40 AM
  5. Replies: 3
    Last Post: 04-05-2012, 04:58 PM
  6. Remove all characters after space
    By vsantoro in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-02-2010, 04:46 PM
  7. Remove varying amounts of space characters
    By Access Joe in forum Excel General
    Replies: 4
    Last Post: 01-13-2006, 06:30 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