Populate Data Validation List

S

Steve

Hi. Is it possible to populate a data validation list with the sheet
names in a workbook? And as a sheet is added or sheet name changed,
the list automatically updates?
 
G

Gary''s Student

First enter this UDF:

Function sheetname(i As Integer) As String
sheetname = ""
If i > Sheets.Count Then Exit Function
sheetname = Sheets(i).Name
End Function


Then, in an unused column, enter:
=sheetname(ROW()) and copy down
 

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