+ Reply to Thread
Results 1 to 3 of 3

Moved entire row based on date

Hybrid View

  1. #1
    Registered User
    Join Date
    10-02-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Moved entire row based on date

    I am under a tight deadline to get a product out and cannot figure it out. I figure this has to be done with a macro, and I am clueless with those. Basically what I need to do is have the section "Future Leave Requests" (rows83 and below) filled out, when the departure date hits, then the row would need to move up to the "personnel on leave" section (Row10-36).

    Same thing goes for the TDY section, the future section (rows 168-182) move up to Current TDY (rows40-55)

    Even if it had to be two sheets to make it easier, I would be fine with that.

    Would I be able to add in rows as needed without screwing it up?

    Thanks for any and all help.
    Attached Files Attached Files
    Last edited by -EA-; 10-03-2012 at 07:23 PM. Reason: solved

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Moved entire row based on date

    try this
    Sub a()
    For arow = 83 To 164
      dep = Range("C" & arow).Value
      If dep <> "" And dep < Date Then
        LR = Cells(37, "C").End(xlUp).Row + 1
        Range("A" & arow & ":E" & arow).Copy
        Range("A" & LR).PasteSpecial xlPasteValues
        Range("A" & arow & ":E" & arow).ClearContents
        Application.CutCopyMode = False
      End If
    Next
    End Sub
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    10-02-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Moved entire row based on date

    Patel45, you have solved my problem. The only change i did was add + 1 after date for it to include today as well to move up. You are a genius! thanks for solving my issue.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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