Automatic archiving of data

jonnygoldsbrough

New Member
Joined
Mar 3, 2015
Messages
4
Hello,

I am a long time forum user but have never had to post before (lucky me!). I am reasonably good with excel but have zero macro/programming knowledge.

I have a excel sheet that details pricing information for some raw materials. These are updated daily.

I would like to schedule this data to export on a daily basis into either another tab or another sheet as an archive. I would intend to make the first column a date column with =today() to differentiate the information. I would want the archive to appear in a single sheet & update the next available row.

I would really appreciate any advice?

Thank you!!

Jonny
UK
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I think I have almost got there. But my current formula doesn't like one line:

Sub ArchiveUpdate()
'
' ArchiveUpdate Macro
Application.ScreenUpdating = False
Dim copySheet As Worksheet
Dim pasteSheet As Worksheet

Set copySheet = Worksheets("Archive daily data")
Set pasteSheet = Worksheets("Archive")

copySheet.Range("A:E").Copy
pasteSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Your copying whole columns which wont fit when your pasting.
You want to copy all, even row 1?
 
Upvote 0
try in a copy

Code:
Sub test()

Dim lr As Integer
Dim wsFrom As Worksheet, wsTo As Worksheet
With Application
    .ScreenUpdating = False
End With

Set wsFrom = ThisWorkbook.Sheets("Archive daily data")
Set wsTo = ThisWorkbook.Sheets("Archive")

'Depending on what column containing the highest rownumber with data, change "A" if needed
lr = wsFrom.Cells(Rows.Count, "[COLOR=#ff0000]A[/COLOR]").End(xlUp).Row
wsFrom.Range("A2:E" & lr).Copy
wsTo.Cells(Rows.Count, 1).End(xlUp).Offset(1).PasteSpecial xlPasteValues

With Application
    .CutCopyMode = False
    .ScreenUpdating = True
End With

End Sub
 
Upvote 0

Forum statistics

Threads
1,215,332
Messages
6,124,314
Members
449,153
Latest member
JazzSingerNL

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top