create sumtable of worksheets names + some data

DutchKevin

Board Regular
Joined
Apr 13, 2011
Messages
133
Office Version
  1. 365
Platform
  1. Windows
Hi Guys, I'm sure i've seen a sollution here or there in the past, but i'm unable to find it again. I'm a newby to VBA but trying hard to catch up.
Here's my case:
I want on workbook_open to automatically list on sheet1 a table with all the other sheetnames (Sheet1,Sheet2,Sheet3..etc).
Next to that namecolumn I would like to present the data of each sheet from certain fixed cells. Always cell B5, D5 or others.
The Mastersheet must automatic, and the following sheets are all identical in layout.

Thanks for helping!
Kevin
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Try this
Code:
Sub ListSheets()
Dim l As Long, wks As Worksheet

For Each wks In ThisWorkbook.Worksheets
    If wks.Name <> Sheet1.Name Then
    l = l + 1
        With Sheet1
            .Cells(l, 1).Value = wks.Name
            .Cells(l, 2).Value = wks.Range("B5").Value
        End With
    End If
Next wks

End Sub
 
Upvote 0
Hi Yard,
Thanks a lot for the help. It works exactly like I needed.
Looking at it, it's not so hard to follow how it works.
I'll tune it to my needs and once again: Thanks!

Kevin
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,253
Members
452,900
Latest member
LisaGo

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