Hi,
i would like to write a code that creats a table of content.
So the code would take the value of B1 on each sheet, and copy it in a new sheet called Table_of_Content.
Here is what i wrote so fare but it doesn't work:
i would like to write a code that creats a table of content.
So the code would take the value of B1 on each sheet, and copy it in a new sheet called Table_of_Content.
Here is what i wrote so fare but it doesn't work:
Code:
' Creating table of content
Dim work**** As Worksheet
Set work**** = Sheets.Add
Sheets.Add.Name = "Table_Of_Content"
' Filling TOC
ActiveWorkbook.Sheets("Table_Of_Content").Activate
Dim WorkS As Worksheet
For Each WorkS In ActiveWorkbook.Worksheets
Range("B1").Copy
ActiveSheet.Paste
Application.CutCopyMode = False
Next WorkS