Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Feb 2008
    Posts
    1,420
    Thanks
    124
    Thanked 5 Times in 5 Posts

    Copy Data to specific Columns

    I have 'total" in Column A

    I need a macro to copy data appears 4 rows below "Total" to the cell below the last row of data before total as follows:

    1) The data in Col A:B below Total (Col A) to be copied to Cols A:B after the last row of data above total
    2) The Total in Col D below Total (Col A) to be copied to Col E after the last row of data
    3) The Total in Col F below Total (Col A) to be copied to Col F after the last row of data (if any)
    4) The Total in Col G below Total (Col A) to be copied to Col G after the last row of data (if any)

    5) The Total in Col I below Total (Col A) to be copied to Col D after the last row of data


    See sample data below. I have highlighted the data which I have manually copied to show you how it must be copied


    Your assistance in this regard is most appreciated
    Attached Files Attached Files
    Last edited by HowardC; 2015-05-27 at 13:22. Reason: change title

  2. #2
    5 Star Lounger
    Join Date
    Jan 2004
    Location
    Praha
    Posts
    988
    Thanks
    56
    Thanked 105 Times in 90 Posts
    "I need a macro to . . ."

    Whatever happened to "Please" ?

    You are running a business on the back of the volunteers who freely contribute their skills and experience on this forum. Show a little more respect !

    Respect would include showing that you had taken the trouble to learn something, anything, from the last 50 times you had asked for help - instead of simply posting another demand for free support.

    PS "Your assistance in this regard is most appreciated" doesn't work - you append it every time and it means just as much as "Have a nice day".
    Last edited by MartinM; 2015-05-27 at 16:12.

  3. #3
    Bronze Lounger
    Join Date
    Feb 2008
    Posts
    1,420
    Thanks
    124
    Thanked 5 Times in 5 Posts
    Hi Martin

    My Apologies. No disrespect was meant at all.

    I have tried to write code, but am unsure of how to tackle this so that the data below total is copied to the correct columns. Please would you please assist me in assisting me in writing code so as that the data from the rows below "Total" are copied to the respective columns after the last row of data above total

    The data in Col A:B below Total (Col A) to be copied to Cols A:B after the last row of data above total
    2) The Total in Col D below Total (Col A) to be copied to Col E after the last row of data
    3) The Total in Col F below Total (Col A) to be copied to Col F after the last row of data (if any)
    4) The Total in Col G below Total (Col A) to be copied to Col G after the last row of data (if any)

    5) The Total in Col I below Total (Col A) to be copied to Col D after the last row of data






    Code:
     Sub Copy_Data
    Dim finalrow As Long, i As Long
    
    finalrow = Range("A65536").End(xlUp).Row + 1
    For i = finalrow To 1 Step -1
    
    Cells(finalrow, i).Resize(3, 15).copy  Destination:=Range("A")  not sure how to get this to copy after last row of data above tototal
    End Sub

Posting Permissions

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