Hello
I have a workbook that has worksheets named for each day of the week
Column A has the date and the row contains that dates data. Is it posible to take the data from each Worksheet and insert the data in date order into one sheet.
I am using Office 2007
Thanks
you can create a macro that grabs all the data you need from each sheet and inserts the data onto a new sheet, once all the data is together, write a macro to sort it ascending. Or have the data pasted into a table and you can sort it however and whenever you like.
try this:
Sub grabdata()
Dim i As Long, s As Long, p As Long
s = 1
' change the 3 to however many worksheets you have plus 1
Do Until s = 3
ActiveWorkbook.Sheets("Sheet" & s).Activate
'you will have to add at the end of this function to fit exactly how many cells you need to grab. (ie i start data at A3 so i need to add + 2 after the parenthesis
i = Application.WorksheetFunction.CountA(Worksheets("Sheet" & s).Range("A1:A50000")) + 2
'change 2 to the row your data is starting
ActiveSheet.Range("A3:B" & i).Select
Selection.Copy
'change sheet name to the name of the sheet where you are pasting data
ActiveWorkbook.Sheets("Paste").Select
p = Application.WorksheetFunction.CountA(Worksheets("Paste").Range("A1:A50000"))
ActiveSheet.Range("A" & p + 1).Select
Selection.PasteSpecial xlValues
s = s + 1
Loop
End Sub