Macro analyzes all sheets and puts result in last sheet

A

andrei

I have an excel book with a lot of sheets . All sheets contain data i
cells from E column .

I need a macro which copies that data to the last sheet in E column
which is empty at start ) with 1 cell empty between data from
different sheets . Example :

Sheet1 : data from E1 to E50 . Sheet 2 : data from E1 to E 25 . Th
result should be put in sheet3 , E column like this : E1 to E50 (copie
from sheet1 ) , E51 empty , E52 to E76 ( copied from sheet2)

I have more than 2 sheets , with different names , so i should be abl
to select how many sheets to be analised , and where to put the result
 
J

joel

Try this


Sub CombineColumnE()

LastSheet = Sheets.Count

For SheetCount = 1 To (LastSheet - 1)
LastRowSource = Sheets(SheetCount).Range("E"
Rows.Count).End(xlUp).Row
LastRowDest = Sheets(LastSheet).Range("E"
Rows.Count).End(xlUp).Row
Sheets(SheetCount).Range("E1:E" & LastRowSource).Copy _
Sheets(LastSheet).Range("E" & (LastRowDest + 1))
Next SheetCount
End Su
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top