Results 1 to 3 of 3

Thread: Move data (XP)

  1. #1
    2 Star Lounger
    Join Date
    Feb 2002
    Location
    Taranaki, New Zealand
    Posts
    193
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Move data (XP)

    Good afternoon
    I hve a spreadsheet with 5 columns.. a, b, c, d and e. In column E I have a date.
    It is at all possible for the data in these 5 columns to shift automatically with a macro to say columns k, l, m, n and o when the date in column e was in the past

    At the moment I have conditional formatting in place, so the 5th columns has a red background when the date was before today and I move them manually.
    The spreadsheet is getting large now and I need the old data.

    Thanks for your help
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Move data (XP)

    You could use this macro:

    Sub MoveColumns()
    Dim r As Long
    Dim m As Long
    m = Range("E" & Rows.Count).End(xlUp).Row
    For r = 2 To m
    If IsDate(Range("E" & r)) And Range("E" & r) < Date Then
    Range("A" & r & ":E" & r).Cut Destination:=Range("K" & r)
    End If
    Next r
    Application.CutCopyMode = False
    End Sub

  3. #3
    2 Star Lounger
    Join Date
    Feb 2002
    Location
    Taranaki, New Zealand
    Posts
    193
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Move data (XP)

    You are sooooo clever. That works perfectly...

    Thanks heaps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •