+ Reply to Thread
Results 1 to 3 of 3

Retain time format whilst formatting cell to text?

  1. #1
    Forum Contributor
    Join Date
    02-15-2005
    Location
    Central UK
    MS-Off Ver
    Office 365
    Posts
    175

    Retain time format whilst formatting cell to text?

    Hi,

    My spreadsheet is to be imported into a SQL database so the format of cells is critical. I have a quantity of cells with time in them e.g. 07:30, 08:15 etc but when I change the format to "Text" they change to 0.3125, 0.34375 etc

    How can I maintain the time format whlst setting the cells to "Text" in order to import the file?

    Can anyone help, please?

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Retain time format whilst formatting cell to text?

    select the cells which you want to change
    Select text to columns under data
    select delimited > select next > again select next > select text under column data format > select finish
    data>text to columns > delimited > next > next > text >finish
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Retain time format whilst formatting cell to text?

    To use the TEXT function like that, you need to tell excel how you want the answer to look, so maybe...
    =TEXT(cell-ref,"HH:MM AM/PM")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Replace text string in a cell and retain rich text formatting (Excel 2013)
    By CharlieBear in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-15-2015, 04:39 PM
  2. [SOLVED] How to subtract time without entering colon and retain time format?
    By blmholland in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-08-2013, 10:36 PM
  3. Time Formatting - Not able to sum up the time when converted to text format.
    By sagarshinde01 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-08-2013, 11:38 AM
  4. [SOLVED] Cannot get a cell to retain formatting when a part of a text string
    By Grimace in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-17-2012, 12:08 AM
  5. Want to retain text format
    By Baalbek in forum Excel General
    Replies: 10
    Last Post: 06-12-2009, 07:35 AM
  6. Retain Numbers as Text Format When Importing.
    By xardoz in forum Excel General
    Replies: 2
    Last Post: 06-20-2006, 12:20 PM
  7. Retain text format from a WORD document
    By Willisbar in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-09-2005, 11: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