View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default Copy and paste same cell from a number of sheets into a new sheet

Hi

Look at this:

Sub CopyDOB()
Dim newSh As Worksheet
Dim DestCell As Range
Set newSh = Worksheets.Add(After:=Worksheets(Worksheets.Count) )
Set DestCell = newSh.Range("A2")
For Each sh In ThisWorkbook.Worksheets
If sh.Name < newSh.Name Then
DestCell = sh.Range("B3").Value
Set DestCell = DestCell.Offset(1, 0)
End If
Next
End Sub

Regards,
Per

"Oliver Burdekin" skrev i meddelelsen
...
Hi there,

I have a number of worksheets that all have the same layout. I would like
to be able to extract or copy the same cell from every worksheet in the
workbook and create a new worksheet containing the data. Is possible to
write a macro for this?

For example, if cell B3 on every worksheet has customer DOB in it and I
have 24 worksheets, I would like to extract B3 from all worksheets and
create a new worksheet containing the data. So the new worksheet would
have 24 DOB's in it and nothing else.

Any help appreciated,

Olly


Submitted via EggHeadCafe - Software Developer Portal of Choice
Treeview Explorer / Dialog for SmartPhone
http://www.eggheadcafe.com/tutorials...er--dialo.aspx