(macro, formula,...) To Copy columm in various sheet's

  • Thread starter Thread starter pmarques
  • Start date Start date
P

pmarques

I have a file in excel with various sheet's, i want to copy the columm H
(from all the sheet's) and paste in only one columm in the same file (or
another), in a automatic way (macro, formula,....).
How can this be done?????

PS. The columm contains numbers (with formulas), and it's in Excel 97


Thanks
:-D
 
untested...

Dim iLastRow As Long
Dim iNextRow As Long
Dim sh As Worksheet
Dim shSumm As Worksheet

Set shSumm = Worksheets.Add
shSumm.Name = "Sum,mary"
iNextRow= 1
For Each sh In Activeworkbook.Worksheets
If sh.Name <> shSumm.Name Then
ilastRow = sh.Cells(Rows.Count,"H").End(xUp).Row
sh.Range("H1").Resize(iLastRow).Copy _
shSumm.Range("H" & iNextRow)
iNextRow = iNextRow + iLastRow
End If
Next sh

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Back
Top