+ Reply to Thread
Results 1 to 13 of 13

Transfer Data depending on date that is older than from the current month

  1. #1
    Registered User
    Join Date
    12-10-2020
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    77

    Transfer Data depending on date that is older than from the current month

    Hello everyone , I hope someone can help with this
    I am looking to create a macro that upon running, will look at the dates in column H and if this dates is before older than from the current month
    or any other words Are recorded manually In the same column , Transfer this rows to archives sheet. With the replacement of the date condition to the word "finished " Then deleted of rows that were moved from the main sheet .... If possible I need flexible way as original data is too large... please check the attached file
    Any help would be greatly appreciated!!! - thanks in advance...
    Attached Files Attached Files

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Transfer Data depending on date that is older than from the current month

    Hi again JACK JOUSH

    Try below code ...
    Please Login or Register  to view this content.
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  3. #3
    Registered User
    Join Date
    12-10-2020
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    77

    Re: Transfer Data depending on date that is older than from the current month

    That's wonderful .. I am so grateful for you Mr. nankw
    What about replacing the date condition with the word finished?

  4. #4
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Transfer Data depending on date that is older than from the current month

    So in “ archives” sheet column H should always have the word “finished” ?

  5. #5
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Transfer Data depending on date that is older than from the current month

    If my understanding is correct, try below code ...
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    12-10-2020
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    77

    Re: Transfer Data depending on date that is older than from the current month

    I'm sure you understand me well
    not always ... if condition is met , The date condition should be replaced with the word "finished"
    As for any other words, they are recorded manually And it is transferred To the archive sheet as it is
    Thank you for your cooperation in advance

  7. #7
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Transfer Data depending on date that is older than from the current month

    Ok, text should remain as is & dates to be converted to "finished"

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    12-10-2020
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    77

    Re: Transfer Data depending on date that is older than from the current month

    Thank you A son of Kuwait, it works perfectly
    I'll come back later after testing the speed code on the real file.
    Best Regards from the deep of my heart

  9. #9
    Registered User
    Join Date
    12-10-2020
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    77

    Re: Transfer Data depending on date that is older than from the current month

    Welcome Mr. nankw
    There is a simple problem , The data should be filtered until the end of each month.
    For testing record this date 30/4/2021 and note that this date .... It is not transferred To the archive sheet ,Thanks again.
    Last edited by JACK JOUSH; 05-13-2021 at 11:34 PM.

  10. #10
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi ! Try this !


    According to the attachment a VBA demonstration as a starter :

    PHP Code: 
    Sub Demo1()
           
    Dim VL&
        
    With Sheet1.[A1].CurrentRegion.Rows
               V 
    = .Parent.Evaluate(Replace("IF({1},(H2:H#<=EOMONTH(TODAY(),-1))+ISTEXT(H2:H#))""#", .Count))
               
    Application.Sum(V)
            If 
    L Then
                    Application
    .ScreenUpdating False
                   
    .Range("I2:I" & .Count).Value2 V
                   
    .Resize(, 9).Sort .Range("I1"), 1Header:=xlYes
                   
    .Columns(9).Clear
              With 
    .Item(.Count ":" & .Count).Columns
                   
    .Item(8).Value2 = .Parent.Evaluate(Replace("IF(ISTEXT(#),#,""Finished"")""#", .Item(8).Address))
                   .
    Cut Sheet2.Cells(Rows.Count1).End(xlUp)(2)
              
    End With
                    Application
    .ScreenUpdating True
            End 
    If
        
    End With
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

  11. #11
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Transfer Data depending on date that is older than from the current month

    Quote Originally Posted by JACK JOUSH View Post
    There is a simple problem , The data should be filtered until the end of each month.
    For testing record this date 30/4/2021 and note that this date .... It is not transferred To the archive sheet
    Do you mean 30/4/2021 date should be transferred to "archives" sheet ? If yes, then you only need to add = in the code as highlighted below, if this is not what you mean, please post a sample file

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    12-10-2020
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    77

    Re: Transfer Data depending on date that is older than from the current month

    Thanks nankw and Marc L
    In fact all solutions offered are very awesome
    Once again, thank you for you help.

  13. #13
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Transfer Data depending on date that is older than from the current month

    Glad to help

+ 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] Adjusting an If statement for a date current or older
    By nickpavlov in forum Excel General
    Replies: 3
    Last Post: 06-23-2020, 02:38 PM
  2. Filling down a table to current month/date with VBA up to current month
    By atombomb99 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-12-2019, 03:34 PM
  3. [SOLVED] Change code so macro activates when entry date is older or equal to current date
    By Big.Moe in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-29-2017, 10:59 PM
  4. Replies: 3
    Last Post: 03-24-2011, 07:30 PM
  5. Transfer data as per there date in there month.
    By Tiya in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-02-2006, 08:35 AM
  6. I want any date 90 days or older from current date change color
    By Big Abalone in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-23-2006, 12:10 AM
  7. Deleting rows older than current date and inserting a new row
    By Dan E. in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-14-2005, 11:20 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