macro to compile columns on multiple sheets

  • Thread starter Thread starter simonsmith
  • Start date Start date
S

simonsmith

Hi there,
Does anyone know how to take data from the same place on multipl
sheets and compile them onto a single sheet (e.g. column A:A from eac
sheet, or cell A1 then put all these onto a single sheet in same o
different workbook)

Thanks

S
 
Simon

Try this for starters
It will copy column A from every sheet not named Summary and paste i
to the next empty column in sheet called Summary.


Sub CopyData()
Dim wS As Worksheet
Dim wsS As Worksheet
Dim iCol As Integer
Set wsS = Sheets("Summary")
For Each wS In Worksheets
If wS.Name <> wsS.Name Then
On Error Resume Next
iCol = Cells.Find(what:="*", searchorder:=xlByColumns, _
searchdirection:=xlPrevious).Column
On Error GoTo 0
iCol = iCol + 1
wS.Columns("a:a").Copy wsS.Cells(1, iCol)
End If
Next wS
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

Back
Top