View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
pikus pikus is offline
external usenet poster
 
Posts: 1
Default Combine worksheet

Sup?

Dim x As Integer
Dim y As Integer

For n = 2 To Sheets.Count 'If the "Totals" sheet is the last sheet the
this line should be "For n = 1 To Workbook.Sheets.Count - 1

With Worksheets(n)
x = .UsedRange.Row - 1 + .UsedRange.Rows.Count
y = .UsedRange.Column - 1 + .UsedRange.Columns.Count

.Range(.Cells(1, 1), .Cells(x, y)).Copy
End With

With Worksheets(1)
x = .UsedRange.Row + .UsedRange.Rows.Count
.Cells(x, 1).Insert
End With

Next n

- Piku

--
Message posted from http://www.ExcelForum.com