+ Reply to Thread
Results 1 to 13 of 13

Auto Change Date format from "." to "/" when copy data from SAP T-code - VF05

  1. #1
    Forum Contributor
    Join Date
    07-09-2013
    Location
    Nagpur, India
    MS-Off Ver
    Excel 2010 / 2013
    Posts
    293

    Auto Change Date format from "." to "/" when copy data from SAP T-code - VF05

    I needed to copy data from VF05 SAP T-Code, in which billing date is in "dd.mm.yyyy" format to my worksheet VF05_UTILITY. I needed the billing date to auto convert into "dd/mm/yyyy" as soon as I paste data from sap vf05.
    Please refer the image and file attached.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Auto Change Date format from "." to "/" when copy data from SAP T-code - VF05

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    07-09-2013
    Location
    Nagpur, India
    MS-Off Ver
    Excel 2010 / 2013
    Posts
    293

    Re: Auto Change Date format from "." to "/" when copy data from SAP T-code - VF05

    This code also converting . to / from the Net Value column when pasting data which I don't want. I only need . to / conversion in billing date (column L) of my worksheet.

  4. #4
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Auto Change Date format from "." to "/" when copy data from SAP T-code - VF05

    try
    Please Login or Register  to view this content.

  5. #5
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Auto Change Date format from "." to "/" when copy data from SAP T-code - VF05

    Try this code under a button

    it tests if L3 is a date or not. if not it will convert the whole column with text to column functionallity
    Please Login or Register  to view this content.
    This code is in Module1.
    I do not use an event code in this case as it only used once after opening
    if you use a selection change event it will trigger the code everytime you change a cell.


    You can call this macro with a button or from the macros menu under Developer Ribbonmenu.

    see attachment

  6. #6
    Forum Contributor
    Join Date
    07-09-2013
    Location
    Nagpur, India
    MS-Off Ver
    Excel 2010 / 2013
    Posts
    293

    Re: Auto Change Date format from "." to "/" when copy data from SAP T-code - VF05

    Quote Originally Posted by nigelog View Post
    try
    Please Login or Register  to view this content.
    Sir,

    This code is converting my billing date "dd.mm.yyy" into "mm/dd/yyyy" format instead of "dd/mm/yyyy" format.

  7. #7
    Forum Contributor
    Join Date
    07-09-2013
    Location
    Nagpur, India
    MS-Off Ver
    Excel 2010 / 2013
    Posts
    293

    Re: Auto Change Date format from "." to "/" when copy data from SAP T-code - VF05

    Quote Originally Posted by Roel Jongman View Post
    Try this code under a button

    it tests if L3 is a date or not. if not it will convert the whole column with text to column functionallity
    Please Login or Register  to view this content.
    This code is in Module1.
    I do not use an event code in this case as it only used once after opening
    if you use a selection change event it will trigger the code everytime you change a cell.


    You can call this macro with a button or from the macros menu under Developer Ribbonmenu.

    see attachment
    This is working but can I have this in my sheet event code as private sub.

  8. #8
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Auto Change Date format from "." to "/" when copy data from SAP T-code - VF05

    OK, that is possible too..

    paste this code into the code module Sheet1(VGF05_UTILITY) then
    Please Login or Register  to view this content.

    small request: please do not use quotes in every reply, it only clutters the topics.

  9. #9
    Forum Contributor
    Join Date
    07-09-2013
    Location
    Nagpur, India
    MS-Off Ver
    Excel 2010 / 2013
    Posts
    293

    Re: Auto Change Date format from "." to "/" when copy data from SAP T-code - VF05

    @Roel sir,
    This code is working on when i paste data in sheet for the first time only. but when I paste rest of my data again in the sheet it is not working. Suppose if i divide my copy area from sap vf05 command then the date format is changing only on my first paste data.
    Last edited by abhinavbinkar; 01-28-2019 at 07:05 AM.

  10. #10
    Forum Contributor
    Join Date
    07-09-2013
    Location
    Nagpur, India
    MS-Off Ver
    Excel 2010 / 2013
    Posts
    293

    Re: Auto Change Date format from "." to "/" when copy data from SAP T-code - VF05

    @nigelog sir,

    I think we need to use CDate function in the code because it is converting into US date format "mm/dd/yyyy" instead of "dd/mm/yyyy" format.

  11. #11
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Auto Change Date format from "." to "/" when copy data from SAP T-code - VF05

    sorry cannot help you then.. it is has become unclear what you need

  12. #12
    Forum Contributor
    Join Date
    07-09-2013
    Location
    Nagpur, India
    MS-Off Ver
    Excel 2010 / 2013
    Posts
    293

    Re: Auto Change Date format from "." to "/" when copy data from SAP T-code - VF05

    Sir,

    Your code is working only when cell L3 is not as Date. But I needed code to change all the cells in column L which is not as in date format.
    I used to copy paste data from sap to my worksheet of many dealers one by one.
    Because of this when I paste data of my first dealer in range for example J3:S19, the code work fine but later when I copy paste data of second dealer in range for example J20 to S30 the code is not working for this range as the cell L3 has been already converted into date.

    Please help sir.

  13. #13
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Auto Change Date format from "." to "/" when copy data from SAP T-code - VF05

    This seems to work continually


    in worksheet Module

    Please Login or Register  to view this content.
    in module

    Please Login or Register  to view this content.

+ 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. Replies: 5
    Last Post: 02-05-2019, 12:03 AM
  2. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  3. Replies: 1
    Last Post: 01-22-2016, 09:21 AM
  4. Replies: 5
    Last Post: 07-16-2015, 10:14 AM
  5. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  6. Date format of just "st" "nd" "rd" and "th" with text included
    By notrandom in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-10-2013, 05:45 PM
  7. How can i copy value from "HTMLText"(EMBED("Forms.HTML:Text","")),using Macro
    By andrewyang in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2010, 12:47 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