printing the list of wroksheets in a workbook

A

Arvi Laanemets

Hi

Copy the function below into VBA module

Public Function TabByIndex(TabIndex As Integer) As String
Application.Volatile
TabByIndex = Sheets(TabIndex).Name
End Function


Into A1 enter the formula
=IF(ISERROR(TABBYINDEX(ROW())),"",TABBYINDEX(ROW()))
and copy down.
 
D

D@annyBoy

thanks
works like a charm


Arvi Laanemets said:
Hi

Copy the function below into VBA module

Public Function TabByIndex(TabIndex As Integer) As String
Application.Volatile
TabByIndex = Sheets(TabIndex).Name
End Function


Into A1 enter the formula
=IF(ISERROR(TABBYINDEX(ROW())),"",TABBYINDEX(ROW()))
and copy down.
 
R

Roman

Try this macro:

sub sheets_list()
r=activecell.row
s=activecell.column
for a = 0 to sheets.count-1
cells(r+a,s).value = sheets(a+1).name
next a
end sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top