+ Reply to Thread
Results 1 to 7 of 7

What's wrong with this recorded macro please ?

  1. #1
    Forum Contributor
    Join Date
    11-02-2003
    Location
    Birmingham, UK
    MS-Off Ver
    Office 365
    Posts
    127

    What's wrong with this recorded macro please ?

    The following is a recorded macro which Paste Special Operation Adds a '0' to dates in order to turn them from text into a date number. The process worked fine when I recorded it, but when I try to run it back it just won't seem to do the Paste Special Operation Add part to turn the text dates into numbers.

    Please Login or Register  to view this content.
    I've recorded and re-recorded all the above steps a few times but still it doesn't work. Would anyone be able to advise please ?

    Thanks

    TW
    Terry

    "... I thought I was a power user of Excel until I came onto these boards..."

  2. #2
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Re: What's wrong with this recorded macro please ?

    Can you please clarify by giving a before and after... i.e How the date appears as text and how it appears after the "0 is added"

  3. #3
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: What's wrong with this recorded macro please ?

    You can try this macro and see how it works for you.

    Please Login or Register  to view this content.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: What's wrong with this recorded macro please ?

    "0" in quotes is not the number 0, but the character string.

    Please Login or Register  to view this content.
    Ben Van Johnson

  5. #5
    Forum Contributor
    Join Date
    11-02-2003
    Location
    Birmingham, UK
    MS-Off Ver
    Office 365
    Posts
    127

    Re: What's wrong with this recorded macro please ?

    The column of dates look like normal dates but are left justified, i.e. text but when I run the macro they don't change at all.

    When I do it manually, this is what happens..

    17/04/15
    becomes
    42111
    which after formatting the cell as Date becomes
    17/04/15

    (i.e. right formatted in the cell as opposed to left formatted)

  6. #6
    Forum Contributor
    Join Date
    11-02-2003
    Location
    Birmingham, UK
    MS-Off Ver
    Office 365
    Posts
    127

    Re: What's wrong with this recorded macro please ?

    Thank you ProtonLeah, feel a fool for not seeing that but then again it was an error created by the macro recorder.. A lesson there..

    Skywriter, that works an absolute treat. Thank you

  7. #7
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: What's wrong with this recorded macro please ?

    Skywriter, that works an absolute treat. Thank you
    My pleasure. Thanks for the rep. points.

+ 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] Recorded macro doing more than recorded?
    By Trending in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-26-2014, 11:42 AM
  2. [SOLVED] Recorded Pivot Table Macro Doesn't Do What I Recorded!
    By diakonos1984 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-26-2013, 11:01 AM
  3. [SOLVED] excel 2007 chart macro graphs data only from sheet on which macro was recorded
    By JW1028 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-19-2013, 06:33 PM
  4. My recorded macro gone wrong?
    By CrashMatRob in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-12-2012, 11:09 PM
  5. Creating a macro which presses a button containing a recorded macro
    By petros89 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-05-2005, 10:05 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