Hello,
I'm brand new to this forum, and very stuck with excel, so any help wil be greatly appreciated.
I have a workbook containing 36 sheets with info on individual birds, each with the bird ID as sheet name, and all with same format. Columns from A to G go; Date, Transmitter, Easting, Northing, Weight, Bill, Comment.
I would like to create a summary sheet which pulls the most recent entry from each worksheet, and compiles them with sheet name (which is also the bird ID) in column A, and the most recent data from that sheet in the adjacent cells, so that the summary has one row of most recent data for each bird.
I also need the summary sheet to be able to automatically update and recognise the new entries as I put them in.
I was hoping this code from another forum would do the trick, as it sounds like the person was after exactly the same thing as me...
"Hi
Insert a sheet called Summary and paste the following codes in the macro window ( Alt F11).
Code:
Sub Harley()Dim a As Long, x As Long, y As LongDim b As String For a = 1 To Sheets.Count b = Worksheets(a).Name If b <> "Summary" Then Sheets("Summary").Cells(a + 1, 1) = b x = Worksheets(a).Range("A65536").End(xlUp).Row Sheets("Summary").Cells(1, 1) = "=MATCH(MAX(" & b & "!A1:A" & x & ")," & b & "!A1:A" & x & ", 0)" y = Sheets("Summary").Cells(1, 1) Worksheets(a).Range("A" & y & ":Z" & y).Copy Sheets("Summary").Cells(a + 1, 2).PasteSpecial End If Next aEnd Sub</PRE>
run the macro. it lists sheet names in col A and pastes the most recent data of that sheet from B to AA."
But when I run this in the macro window it comes up with a "run time error 1004"
I have no idea why this is happening, so any help with re-writing this code to fix it, or a brand new code would be fantastic.
Thanks,
Rachael.
I'm brand new to this forum, and very stuck with excel, so any help wil be greatly appreciated.
I have a workbook containing 36 sheets with info on individual birds, each with the bird ID as sheet name, and all with same format. Columns from A to G go; Date, Transmitter, Easting, Northing, Weight, Bill, Comment.
I would like to create a summary sheet which pulls the most recent entry from each worksheet, and compiles them with sheet name (which is also the bird ID) in column A, and the most recent data from that sheet in the adjacent cells, so that the summary has one row of most recent data for each bird.
I also need the summary sheet to be able to automatically update and recognise the new entries as I put them in.
I was hoping this code from another forum would do the trick, as it sounds like the person was after exactly the same thing as me...
"Hi
Insert a sheet called Summary and paste the following codes in the macro window ( Alt F11).
Code:
Sub Harley()Dim a As Long, x As Long, y As LongDim b As String For a = 1 To Sheets.Count b = Worksheets(a).Name If b <> "Summary" Then Sheets("Summary").Cells(a + 1, 1) = b x = Worksheets(a).Range("A65536").End(xlUp).Row Sheets("Summary").Cells(1, 1) = "=MATCH(MAX(" & b & "!A1:A" & x & ")," & b & "!A1:A" & x & ", 0)" y = Sheets("Summary").Cells(1, 1) Worksheets(a).Range("A" & y & ":Z" & y).Copy Sheets("Summary").Cells(a + 1, 2).PasteSpecial End If Next aEnd Sub</PRE>
run the macro. it lists sheet names in col A and pastes the most recent data of that sheet from B to AA."
But when I run this in the macro window it comes up with a "run time error 1004"
I have no idea why this is happening, so any help with re-writing this code to fix it, or a brand new code would be fantastic.
Thanks,
Rachael.