Need to create a macro

Closed
Report
Posts
1
Registration date
Thursday February 5, 2015
Status
Member
Last seen
February 5, 2015
-
Posts
1325
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
November 17, 2021
-
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 replies

Posts
279
Registration date
Wednesday June 19, 2013
Status
Contributor
Last seen
April 28, 2016

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
Posts
1325
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
November 17, 2021
240
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.