G
gypmaster
Hi,
First post here so forgive my abject ignorance....
I've got a workbook with multiple sheets - don't necessarily know ho
many.
I want, when I click a button, to clear out a Summary sheet, loo
through all existing sheets in the workbook and copy the same cell
from each sheet into a cell on the Summary. OBviously, after I'v
copied the cells from the first sheet in to the Summary sheet I want t
copy the cells from the next sheet in to the next cell down in th
Summary sheet. Here's my code so far....
Private Sub CommandButton1_Click()
Rows("5:125").Select
Selection.Delete Shift:=xlUp
For Each ws In Worksheets
If ws.Name <> "Summary" Then
Worksheets(ws.Name).Activate
Worksheets(ws.Name).Range("A2:F2").Cop
Destination:=Worksheets("Summary").Range("E5")
MsgBox ws.Name
wrk = wrk + 1
End If
Next ws
Worksheets("Summary").Select
End Sub
Now this code will only copy the selected cells in to Range E5 on th
Summary sheet.
Anyone tell me how to use a variable to make sure the data is copie
into the next cell down?
Thanks in advance
First post here so forgive my abject ignorance....
I've got a workbook with multiple sheets - don't necessarily know ho
many.
I want, when I click a button, to clear out a Summary sheet, loo
through all existing sheets in the workbook and copy the same cell
from each sheet into a cell on the Summary. OBviously, after I'v
copied the cells from the first sheet in to the Summary sheet I want t
copy the cells from the next sheet in to the next cell down in th
Summary sheet. Here's my code so far....
Private Sub CommandButton1_Click()
Rows("5:125").Select
Selection.Delete Shift:=xlUp
For Each ws In Worksheets
If ws.Name <> "Summary" Then
Worksheets(ws.Name).Activate
Worksheets(ws.Name).Range("A2:F2").Cop
Destination:=Worksheets("Summary").Range("E5")
MsgBox ws.Name
wrk = wrk + 1
End If
Next ws
Worksheets("Summary").Select
End Sub
Now this code will only copy the selected cells in to Range E5 on th
Summary sheet.
Anyone tell me how to use a variable to make sure the data is copie
into the next cell down?
Thanks in advance