Consulting

Results 1 to 3 of 3

Thread: Solved: Moving row to another space

  1. #1
    VBAX Mentor
    Joined
    Aug 2011
    Posts
    353
    Location

    Solved: Moving row to another space

    On the attached sheet, I would like to move the cash row in A6 and insert it above the total portfolio row in A63. The complicated part of this is that although the cash row will always be in A6, the portfolio row will be located anywhere based on different reports.

    How do I write a macro to find the total portfolio line and know to move row A6 and insert it above that line?

    Thanks for the great help!
    Attached Files Attached Files

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Public Sub ProcessData()
    Dim Lastrow As Long

    With ActiveSheet

    Lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
    .Rows(6).Copy
    .Rows(Lastrow).Insert
    End With
    End Sub[/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Mentor
    Joined
    Aug 2011
    Posts
    353
    Location
    Thank you!!

Posting Permissions

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