Need to create a macro

Closed
bettyjk Posts 1 Registration date Thursday February 5, 2015 Status Member Last seen February 5, 2015 - Feb 5, 2015 at 06:37 AM
vcoolio Posts 1404 Registration date Thursday July 24, 2014 Status Moderator Last seen September 15, 2023 - Feb 6, 2015 at 08:10 PM
i have no clue on how to create a macro.i need to copy all items in sheet 1 rows to columns in sheet 2 every time its updated. sheet one will change every week but sheet 2 should hold historic data.Please help

2 responses

MrIstar Posts 279 Registration date Wednesday June 19, 2013 Status Contributor Last seen April 28, 2016
Feb 6, 2015 at 09:46 AM
Hi there !

I was looking through Internet and I found the solution.
Just take a look at This Page.

Good Luck !

Open your eyes, look within. Are you satisfied with the life you're living?
*Bob Marley
0
vcoolio Posts 1404 Registration date Thursday July 24, 2014 Status Moderator Last seen September 15, 2023 259
Feb 6, 2015 at 08:10 PM
Hello Betty,

Do you need all the data in Sheet1 to be transferred to sheet2 at once or do you need certain rows of data to be transferred at a time?

If you could upload a sample of your work book, it would be easier for us to see what you would like to do. You can upload using a file sharing site such as DropBox. Be careful with any sensitive data.

As a starting point, this code may help:-
Sub BettyDataTransfer()
    With Sheet1.UsedRange.Offset(1, 0)
         Sheet2.Cells(2, 1).Resize(.Rows.Count, .Columns.Count) = .Value
         
    End With
         Sheet1.UsedRange.Offset(1, 0).Clear
End Sub


This code will transfer all your data from sheet1 to sheet2 at once and clear it from sheet1.

Let us know if we can help further.

Regards,
vcoolio.
0