Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I have got a workbook wiht 10 sheets that I want to make
a summary of on a new shteet I need a macro to copy Range B1:C up to where the cells with data ends in the first sheet to the new sheet then go back to the next sheet and copy the same range (the amount of lines can differ)and paste where in the frist sell with no data underneath the first copy paste data Hope I make sense. The sheets has got diferendt names like Floraland, JFK, Franay. |
#2
![]() |
|||
|
|||
![]()
Maybe this little macro will get you closer to what you want.
Option Explicit Sub testme() Dim mySelectedSheets As Sheets Dim wks As Worksheet Dim RngToCopy As Range Dim newWks As Worksheet Dim DestCell As Range Set mySelectedSheets = ActiveWindow.SelectedSheets ActiveSheet.Select Set newWks = Worksheets.Add Set DestCell = newWks.Range("a1") For Each wks In mySelectedSheets With wks Set RngToCopy = .Range("b1", .Cells(.Rows.Count, "c").End(xlUp)) RngToCopy.Copy _ Destination:=DestCell With newWks Set DestCell = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0) End With End With Next wks End Sub It copies B1:C(last used cell in C) to a new sheet for each of the grouped sheets. So select the first sheet, then ctrl-click on the tabs of the other sheets you want. If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm Es wrote: I have got a workbook wiht 10 sheets that I want to make a summary of on a new shteet I need a macro to copy Range B1:C up to where the cells with data ends in the first sheet to the new sheet then go back to the next sheet and copy the same range (the amount of lines can differ)and paste where in the frist sell with no data underneath the first copy paste data Hope I make sense. The sheets has got diferendt names like Floraland, JFK, Franay. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MACRO - copy rows based on value in column to another sheet | Excel Discussion (Misc queries) | |||
Can a macro format a hidden sheet? | Excel Discussion (Misc queries) | |||
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. | Excel Discussion (Misc queries) | |||
Copy formula...sheet 2 sheet | New Users to Excel | |||
Need Macro to copy specific sheet | Excel Worksheet Functions |