+ Reply to Thread
Results 1 to 5 of 5

Macro - Delete multiple rows - Not working perfectly

Hybrid View

Bastien43 Macro - Delete multiple rows... 08-21-2021, 01:17 PM
AlphaFrog Re: Macro - Delete multiple... 08-21-2021, 04:33 PM
Bastien43 Re: Macro - Delete multiple... 08-22-2021, 04:08 AM
Greg M Re: Macro - Delete multiple... 08-23-2021, 06:46 AM
AlphaFrog Re: Macro - Delete multiple... 08-23-2021, 11:32 AM
  1. #1
    Registered User
    Join Date
    07-16-2021
    Location
    France
    MS-Off Ver
    2019
    Posts
    2

    Question Macro - Delete multiple rows - Not working perfectly

    Hello,

    I have a macro and today it doesn't work anymore.

    The goal is to keep one date and delete all the others.

    I’m attaching the macro ("corrector") and 3 test files. It is necessary to put all the files in one folder. I’m on Excel 2019.

    What changes I have to do ? Why it doesn't work anymore?

    Thank you
    Bastien
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Macro - Delete multiple rows - Not working perfectly

    I can only guess that your date format changed in your "q" files.

    Change This...
    dDate = CDate(sDate)
    To This...
    sDate = Format(CDate(sDate), "dd/mm/yyyy")

    And search for sDate
                Set rCelA = .Columns(1).Find(what:=sDate, lookat:=xlPart, LookIn:=xlFormulas, searchdirection:=xlNext)
                Set rCelB = .Columns(1).Find(what:=sDate, lookat:=xlPart, LookIn:=xlFormulas, searchdirection:=xlPrevious)
    Last edited by AlphaFrog; 08-23-2021 at 11:30 AM. Reason: sp
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    07-16-2021
    Location
    France
    MS-Off Ver
    2019
    Posts
    2

    Re: Macro - Delete multiple rows - Not working perfectly

    Hello

    Thank you very much, it is working great

    it helps me a lot

    thank
    Bastien

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,645

    Re: Macro - Delete multiple rows - Not working perfectly

    Hi AlphaFrog,

    Nice diagnosis, and very impressive mind-reading!


    I have a macro and today it doesn't work anymore
    didn't really give you a lot to work with


    Thanks for all of your contributions on here.

    Regards,

    Greg M

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Macro - Delete multiple rows - Not working perfectly

    Thanks Greg.

+ 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. Code not working Perfectly when on another platform
    By Nothando in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-29-2021, 02:26 AM
  2. [SOLVED] Macro working perfectly on MS office x86 but not working on x64
    By alexgoaga in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-26-2017, 05:04 AM
  3. Macro to delete first working sheet in multiple files
    By Kaapoff in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-06-2014, 05:59 AM
  4. Delete Rows Based On Empty Cell in Column Works Perfectly For A, but Not J
    By votekinky06 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-27-2014, 05:41 PM
  5. [SOLVED] Excel 2010 Macro not working on Windows 7 but same works perfectly on XP
    By rahulwagh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-01-2013, 02:14 PM
  6. Delete Rows Macro Not Working
    By fmluder93 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2009, 06:31 AM
  7. PasteSpecial not working perfectly
    By ctmurray in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-12-2008, 04:20 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