logo elektroda
logo elektroda
X
logo elektroda

Excel Date Format Alteration: Copying Cells and Retaining Original Format

drzarul 6681 3
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 17995496
    drzarul
    Level 2  
    Hello,

    I have a problem with excel, I need to copy the date from cells and insert it into another one, but excel automatically changes its format, I can't change it to the format that I need. an example is attached
  • ADVERTISEMENT
  • #2 17995502
    actin
    Level 34  
    Select the cells where you want to copy these dates then click Number Format-> Text. Now everything will be copied in the same format as it came from the original cell.
  • ADVERTISEMENT
  • #3 17995510
    drzarul
    Level 2  
    It works but only for newly entered dates. If I have already completed dates in cells, after changing them to text, it changes them to "text", that is, for example: "43445"
  • #4 17995862
    Maciej Gonet
    VBA, Excel specialist
    It is not known what exactly you mean. You write about copying and in the example you have references to cells with dates, which is quite different. Excel uses different methods of writing the dates. If a date is identified as a date (number), its format is determined by the cell format. In your example, the system formatting is set, so what exactly is it for you - it is not known, because everyone who opens your file sees their own system format.
    The formula you used combines the contents of two date cells into one text. Unfortunately, this cannot be done in a universal way. If you reference a formatted cell in a text expression, the formatting disappears. They must be specified explicitly with the TEXT function. But this will be the formatting determined by a specific format code, and what is yours - we do not know. If you have dates with dots then you should use something like this:
    Code: Text
    Log in, to see the code
    If you use a different date format, use your own format. However, the result will not match if you change the format in the source cells.
ADVERTISEMENT