Creating Summary Tab based on information in other tabs

SkyeS

New Member
Joined
May 21, 2015
Messages
40
So I am looking to make a macro to do the following:
  • Find the number of tabs with "Test" in the first cell (A1)
  • For each tab:
    • Copy sheet name and paste into Sheet named "Main"
    • Copy row 6 from sheet and paste into Sheet named "Main"
    • Continue until all sheets with the "test" in the first cell are completed

Any Help is welcome!
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
How about
Code:
Sub Copytest()

   Dim Ws As Worksheet
   
   For Each Ws In Worksheets
      If InStr(1, Ws.Range("A1").Value, "test", vbTextCompare) > 0 Then
         With Sheets("Main").Range("A" & Rows.Count).End(xlUp).Offset(1)
            .Value = Ws.Name
            Ws.Rows(6).Copy .Offset(1)
         End With
      End If
   Next Ws
End Sub
 
Upvote 0
This worked perfectly!! Thank you so much for your help! I was really struggling to figure out an efficient way to do this.

Once again thank you ! :-D
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top