Macro for part of W/book sheets

  • Thread starter TUNGANA KURMA RAJU
  • Start date
T

TUNGANA KURMA RAJU

I am looking for a macro that gives sheet names of w/book next to current
sheet.
Suppose I place this macro in sheet 6 ,from sheet 7 to end of W/book sheet
names be listed in this sheet 6 from range A2:A100.Any body Pl. try and post
me.
 
D

davesexcel

Sub wsnames()
Set r = Sheets(1).Range("a1")
For i = 1 To Sheets.Count
r.Cells(i, 1) = Sheets(i).Name
Next i
End Sub

Because this code names all the sheets;
You can alter the code to Sheet(6), and add;
Range("A1:A6").Select
Selection.ClearContents
after Next i
 
T

TUNGANA KURMA RAJU

THANKS.very good idea.In last line I have added (instead of clearcontents)
selection.Delete Shift:= xlUp.
 
Top