+ Reply to Thread
Results 1 to 8 of 8

Convert two different format/values into one format

  1. #1
    Registered User
    Join Date
    04-29-2019
    Location
    Katowice
    MS-Off Ver
    2013
    Posts
    23

    Convert two different format/values into one format

    Hello,
    I’m new to excel VBA programming and have a pretty big challenge ahead of me – I’ll appreciate your thoughts on that. Let me describe my problem.
    I have a data copied from some source where one of the columns is intentionally formatted in two different formats – text and date, for example there’s “01-Jan” and “0-1”. I’d like to have both of the values to be in text format so that I have “1-1” and “0-1”.
    Is there any way to replace the date format with text format and copy it to some parallel column ?
    Or maybe there's some other way than via the vba code ?

    Any help will be appreciated!
    Charles

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Convert two different format/values into one format

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    04-29-2019
    Location
    Katowice
    MS-Off Ver
    2013
    Posts
    23

    Re: Convert two different format/values into one format

    Attached. This is just an example based on a few lines.

    Let me know if this is doable please.

    Thank you,
    Charles
    Attached Files Attached Files

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Convert two different format/values into one format

    format as shown in picture Custom Format.Attachment 622063
    Attached Images Attached Images
    Last edited by alansidman; 04-29-2019 at 01:12 PM.

  5. #5
    Registered User
    Join Date
    04-29-2019
    Location
    Katowice
    MS-Off Ver
    2013
    Posts
    23

    Re: Convert two different format/values into one format

    Cannot open the picture, can you re-upload it ?

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Convert two different format/values into one format

    basically, you need to highlight the column. Open the Format tab on the ribbon and go to Custom. Set the custom setting to m-d.

    I thought a picture would work. Apparently not for your browser. I use Chrome and it opens ok for me.

  7. #7
    Registered User
    Join Date
    04-29-2019
    Location
    Katowice
    MS-Off Ver
    2013
    Posts
    23

    Re: Convert two different format/values into one format

    It opened just now. Thank you.
    I figured out this solution too, however it only partially resolves my issue. The thing is that when I reference the cell that was originally copied from the source (date format) and use for example LEFT and RIGHT functions to take the numbers without the dash into two separate cells then it still sees the data as date and whenever copied as values to another cell it returns for example "43466" for "1-1" (01-Jan).

    Is there any way to avoid this ?

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Convert two different format/values into one format

    When you copy the data, paste Special Values. It will eliminate the formulas.

+ 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. [SOLVED] Convert Dates from Apr 11, 2018 format to numeric format MM/DD/YYYY
    By worswick25 in forum Excel General
    Replies: 16
    Last Post: 04-17-2018, 06:38 AM
  2. How to Convert Custom Format to Values
    By Sandi99 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-26-2017, 11:36 AM
  3. [SOLVED] Convert Cell values with fixed format values
    By Parth007 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-23-2016, 08:38 AM
  4. [SOLVED] Require vba or formula for convert general format data in date format
    By santosh226001 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-10-2013, 03:53 AM
  5. Convert date and time in serial number format to text format
    By nda13112 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-11-2013, 02:45 PM
  6. Excel: How to convert time format into number format that can be added?
    By Frances Jones in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-17-2012, 04:10 PM
  7. Convert numbers from text format to number format
    By merlin68 in forum Excel General
    Replies: 4
    Last Post: 04-12-2005, 09:06 AM

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