View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Otto Moehrbach Otto Moehrbach is offline
external usenet poster
 
Posts: 1,090
Default auto copy from one sheet to another

This macro should do what you want. I assumed that the file has 5 sheets as
you said and that one is named Summary. This macro copies what you say you
want from all the other sheets to the Summary sheet. HTH Otto
Sub CopyToSummary()
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
If ws.Name = "Summary" Then GoTo NextSheet
With ws
If IsEmpty(.Range("A2").Value) Then GoTo NextSheet
.Range("A2", .Range("A" & Rows.Count).End(xlUp)).Resize(,
2).Copy
Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial
.Range("E2", .Range("E" & Rows.Count).End(xlUp)).Copy
Range("C" & Rows.Count).End(xlUp).Offset(1).PasteSpecial
End With
NextSheet:
Next ws
Application.ScreenUpdating = True
End Sub

"JOUIOUI" wrote in message
...
I'll be creating a workbook with 5 sheets that folks will use each day to
submit information on. The first 4 sheets will have data entered in
columns
A, B, C, D, E, F and G. The number of rows each day with data entered is
variable and on some days a sheet may even be empty. My goal is to have
the
5th Sheet be a summary page and is titled, "Summary". On this summary
sheet
I only want to copy the informaiton from Columns A, B and E from the
sheets
titled "First", "Second", "Third" and "Fourth" only when data is entered
beginning on row 2 since there are column headings on each sheet. I'm
just
not sure how to designate to copy the text from one sheet to another whe
when
the number of rows pupulated on each sheet is unknown. Any ideas are
appreciated, thank you