+ Reply to Thread
Results 1 to 11 of 11

Disable buffer clearing at a given cell format (NumberFormat = "m/d/yyyy")

  1. #1
    Registered User
    Join Date
    09-02-2022
    Location
    World
    MS-Off Ver
    2019
    Posts
    15

    Disable buffer clearing at a given cell format (NumberFormat = "m/d/yyyy")

    Cross-posted at https://www.mrexcel.com/board/thread...macro.1215634/

    Hello

    I have a macro:

    Please Login or Register  to view this content.
    When copying (ex: may20, may-20) from another column to column A in Excel itself with this macro, it allows to paste only once - the next cell is no longer pasted, apparently the clipboard is cleared after the first paste. I have to copy again from another column. How it can be corrected?
    Last edited by 6StringJazzer; 09-05-2022 at 10:55 AM. Reason: added xpost link

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Disable buffer clearing at a given cell format (NumberFormat = "m/d/yyyy")

    There is no copy and no paste in this code. No idea what you are asking.

    Also I would not assign Empty. If you want to clear the cell I suggest

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    09-02-2022
    Location
    World
    MS-Off Ver
    2019
    Posts
    15

    Re: Disable buffer clearing at a given cell format (NumberFormat = "m/d/yyyy")

    Quote Originally Posted by 6StringJazzer View Post
    There is no copy and no paste in this code. No idea what you are asking.
    If I assign a value (NumberFormat = "m/d/yyyyy") by cells in column A using a macro (as in my case), then after that I cannot insert (for example: may20, may-20, etc.) from another cell into cells in column A more than once. For example, how copy mode is used in Excel. The cell copy mode is cancelled if the user starts editing the cell.


    My macro was used to solve this problem:

    I have dates as MonthYear, Month-Year (ex: May20, May-21 etc.) but I need them to be in dd.mm.yyyy format.

    For example:
    Aug20, needs to become 01.08.2020.
    May-19, needs to become 01.05.2019.
    Jul18, needs to become 01.07.2018.
    Nov-17, needs to become 01.11.2017.
    etc.

    If enter something other than MouthYear, Mouth-Year, then nothing is entered into the cells, they remain empty.
    Last edited by moninah; 09-02-2022 at 06:24 PM.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Disable buffer clearing at a given cell format (NumberFormat = "m/d/yyyy")

    I don't know what language is spoken in "World" but I think we have a language barrier because you started talking about copy/paste, yet you have still not show any code that does a copy or a paste, and then you talk about date formats, but I still don't understand your question.

    If you are trying to convert date formats, which is completely unrelated to your thread title and first post, then maybe

    Please Login or Register  to view this content.
    But I suggest you attach a file with sample data and your code.

  5. #5
    Registered User
    Join Date
    09-02-2022
    Location
    World
    MS-Off Ver
    2019
    Posts
    15

    Re: Disable buffer clearing at a given cell format (NumberFormat = "m/d/yyyy")

    I described what the macro is used for in comment #3. The macro only performs date conversions. But when the macro works, when you try to copy words from another cell (for example: may20 or may-21, etc.) to any cell in column A, you can only paste once after copying, then the clipboard is cleared and the words are respectively deleted. I need to tweak something in my macro to prevent this from happening. So that after copying I can paste into the cells of column A an unlimited number of times may20 or may-21.

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Disable buffer clearing at a given cell format (NumberFormat = "m/d/yyyy")

    I suggest you attach a file with sample data and your code.

  7. #7
    Registered User
    Join Date
    09-02-2022
    Location
    World
    MS-Off Ver
    2019
    Posts
    15

    Re: Disable buffer clearing at a given cell format (NumberFormat = "m/d/yyyy")

    Attaching the file.
    Attached Files Attached Files

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Disable buffer clearing at a given cell format (NumberFormat = "m/d/yyyy")

    I cannot reproduce your problem. I run your macro on G7, copy G7, then paste it 5 times in various cells in column A.

  9. #9
    Registered User
    Join Date
    09-02-2022
    Location
    World
    MS-Off Ver
    2019
    Posts
    15

    Re: Disable buffer clearing at a given cell format (NumberFormat = "m/d/yyyy")

    Quote Originally Posted by 6StringJazzer View Post
    I cannot reproduce your problem. I run your macro on G7, copy G7, then paste it 5 times in various cells in column A.
    Why are you running the macro on G7? By default, the macro automatically runs in column A. And then try copying from G7 to any cell in column A.

  10. #10
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Disable buffer clearing at a given cell format (NumberFormat = "m/d/yyyy")

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not told us about this. You are required to do so.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    I have added the link to your first post since you are a new member

  11. #11
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Disable buffer clearing at a given cell format (NumberFormat = "m/d/yyyy")

    Now I see what you are trying to explain. As you note in your first post, the problem is that when a macro starts to run, the clipboard is cleared. When you do a copy and paste using the worksheet interface, the Worksheet_Change event is triggered, clearing the clipboard. It doesn't matter what cell is changed; Worksheet_Change is called for any change. So you can't paste more than once. I will look further to see if there is a solution to this but I don't know of one offhand.

+ 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] Make "WeekdayName" Function Work With "dd/mm/yyyy" Format
    By KMVKMVKMV in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-30-2019, 02:30 PM
  2. Replace date in "DD.MM.YYYY" with date "DD/MM/YYYY" format as soon as user hits enter
    By abhinavbinkar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-14-2019, 09:12 AM
  3. [SOLVED] Check Date Format Input into Excel Column with VBA code ("DD/MM/YYYY" format)
    By inoka in forum Excel Programming / VBA / Macros
    Replies: 44
    Last Post: 04-17-2018, 05:26 AM
  4. [SOLVED] Check Date Format Input into Excel Column with VBA code ("DD/MM/YYYY" format)
    By inoka in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 12-14-2017, 08:30 AM
  5. [SOLVED] Excel cell automatically converting into "[$-en-SG,1]dd/mm/yyyy;@" Custom format
    By rajeshn_in in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-18-2017, 02:14 AM
  6. [SOLVED] Convert from "general" (YYYYMMDD) to specific "custom" format (YYYY.MM.DD)
    By Ella_p in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-10-2013, 02:23 AM
  7. Replies: 0
    Last Post: 08-09-2012, 04:31 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