macro to list created tabs on to a worksheet

MATEAPOT

New Member
Joined
Jul 5, 2008
Messages
14
I have adapted this code to create tabs in my workbook.i need to make it display the created tabs in a worksheet on the workbook.is this possible?



With ActiveSheet
lngLastRow = Range("A" & Rows.Count).End(xlUp).Row
For lngLoopCtr = 1 To lngLastRow Step 1
strNewSheetname = Sheets(ws.Name).Cells(lngLoopCtr, "A")
On Error Resume Next
Sheets(strNewSheetname).Select
If Err Then
Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = strNewSheetname
Worksheets(ws.Name).UsedRange.Copy
ActiveSheet.Range("a2").PasteSpecial

End If
Sheets("ws.Name").Cells(lngLoopCtr, "AH:H8").Copy Sheets(strNewSheetname).Cells(1, "AH:H8")
On Error GoTo 0
Next lngLoopCtr
End With
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
I think if you add a worksheet to your workbook called "List", then the following should work:

Code:
Worksheets("List").Select
Range("A" & Rows.count).End(xlDown).row.Value = strNewSheetname
 
Upvote 0
Thanks for the quick reply.after running this macro several times i realised that there is a possibilty that it can replace an already existing sheet in the workbook.How can i prevent this?.I need a macro that will ,using a value in sheet1 cell A1 creates 3 unique tabs ,copy the range in sheet1 to these sheets,then paste the names of the newly created tabs to a sheet called List.
 
Upvote 0

Forum statistics

Threads
1,215,035
Messages
6,122,791
Members
449,095
Latest member
m_smith_solihull

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