View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
mudraker
 
Posts: n/a
Default macro to compile columns on multiple sheets


Simon

Try this for starters
It will copy column A from every sheet not named Summary and paste it
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 Sub


--
mudraker
------------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
View this thread: http://www.excelforum.com/showthread...hreadid=540120