+ Reply to Thread
Results 1 to 5 of 5

Truncate a cell value and paste in another cell

  1. #1
    Forum Contributor
    Join Date
    08-03-2009
    Location
    Cary, NC
    MS-Off Ver
    Excel 2016
    Posts
    109

    Truncate a cell value and paste in another cell

    I need VB code...

    The following value appears in a cell:

    2/4/2014 9:52:43 PM

    I want to capture just the date 2/4/2/14 and paste it in another cell on another sheet and change the format to Rotate Text Up.
    Last edited by bishoposiris; 02-23-2014 at 07:32 AM. Reason: Solved

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Truncate a cell value and paste in another cell

    As dates are stored as numbers of days since an arbitrary point in the past, you can trim off the time by using the INT function to loose the decimal portion. Format the cell containing the formula with Format cells setting number format to date and rotation as appropriate.
    Martin

  3. #3
    Forum Contributor
    Join Date
    08-03-2009
    Location
    Cary, NC
    MS-Off Ver
    Excel 2016
    Posts
    109

    Re: Truncate a cell value and paste in another cell

    I appreciate your response but I need the vb code to make this happen.

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Truncate a cell value and paste in another cell

    Try this.

    Please Login or Register  to view this content.
    Assumes that the original date in in A1 and the output cell is E1

  5. #5
    Forum Contributor
    Join Date
    08-03-2009
    Location
    Cary, NC
    MS-Off Ver
    Excel 2016
    Posts
    109

    Re: Truncate a cell value and paste in another cell

    Awesome! Thanks for the help!
    Last edited by bishoposiris; 02-23-2014 at 07:31 AM.

+ 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. Need to truncate a cell if the character length is over 100
    By Xaos in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-29-2013, 02:09 PM
  2. How to truncate the content of a cell?
    By vvvv in forum Excel General
    Replies: 2
    Last Post: 01-29-2007, 05:22 AM
  3. Truncate cell content after a certain character
    By brakai295 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-19-2006, 07:33 AM
  4. [SOLVED] Truncate number in cell
    By Chris Hedlund in forum Excel General
    Replies: 5
    Last Post: 05-12-2006, 11:30 AM
  5. [SOLVED] Truncate Cell text all the time
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2005, 01:05 PM

Tags for this Thread

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