View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Christian[_8_] Christian[_8_] is offline
external usenet poster
 
Posts: 17
Default get value from same cell on all sheets in a workbook.

Hi Gene

The following code will extract the data from A$ of every sheet and and
transfers it to a sheet
named summary with the sheet name.
Hope this is what you were looking for

Private Sub CommandButton1_Click()
Dim ws As Worksheet
i = 1
Sheets.Add
ActiveSheet.Name = "Summary"
For Each ws In Worksheets
Worksheets(ws.Name).Select
Worksheets(ws.Name).Range("a4").Select
Worksheets(ws.Name).Range("a4").Copy
Destination:=Worksheets("Summary").Cells(i, 2)
Worksheets("Summary").Cells(i, 1) = ws.Name
i = i + 1
Next ws
End Sub

Cheers Christian