+ Reply to Thread
Results 1 to 2 of 2

Thread: Rotate Current Record to last

  1. #1
    Registered User
    Join Date
    05-11-2010
    Location
    A far away land
    MS-Off Ver
    Excel 2003
    Posts
    38

    Question Rotate Current Record to last

    I have a database with a table with 1 to 10 records. I want to be able to open the form view and get the first record. I then want to be able to rotate the current record so it will be the last record in the table/form. Is there an easy macro to do this?

  2. #2
    Valued Forum Contributor tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    USA
    MS-Off Ver
    Excel 2003 - 2007
    Posts
    2,325

    Re: Rotate Current Record to last

    Rodeoclown,

    Something like this?
    Sub RotateValuesMacro_for_Rodeoclown()
        
        Const DataCol As String = "A"
        Const StartRow As Long = 2
        
        Dim arrData() As Variant: arrData = Range(DataCol & StartRow + 1, Cells(Rows.Count, DataCol).End(xlUp)).Value
        Range(DataCol & StartRow).Offset(UBound(arrData, 1), 0).Value = Range(DataCol & StartRow).Value
        Range(DataCol & StartRow).Resize(UBound(arrData, 1), 1).Value = arrData
        
    End Sub


    Hope that helps,
    ~tigeravatar

+ 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.2.0