Answering my own question from the previous post, here is a short UDF that will return a list of worksheet names, starting with any chosen sheet:
Categories
RSS Feed
Search NewtonExcelBach
Archives
Top Posts
- Using LINEST for non-linear curve fitting
- Cubic Splines
- Using LinEst() on data with gaps
- Biaxial bending update
- Continuous Beams With Spring Supports by Macaulay’s Method
- Fitting high order polynomials
- Buckling of columns with varying cross section
- Daily Download 3: ULS design of reinforced concrete sections
- Retrieving unique values from a range or array ...
- Smart Indenter and Excel 2013
Recent Comments

Z on Downloads py_xlCBA – Sup… on py_xlCBA update 
dougaj4 on Downloads 
Z on Downloads py_xlCBA update | Ne… on Calling PyCBA from Excel 
Z on Reinforced concrete elastic an… 
dougaj4 on Reinforced concrete elastic an… 
khoitsma on Continuous beam animations wit… 
Z on Reinforced concrete elastic an… 
dougaj4 on Reinforced concrete elastic an… 
dougaj4 on Reinforced concrete elastic an… 
Z on Reinforced concrete elastic an… 
Z on Reinforced concrete elastic an… 
dougaj4 on Downloads 
dougaj4 on Installing Adobe Reader non-DC…
There’s an alternative approach using defined names with some of those names calling XLM functions. See
http://groups.google.com/group/microsoft.public.excel.worksheet.functions/msg/e803e69927d7164e
LikeLike
Hi Doug,
I think I would have spat it in to one cell, with a “,” between names, what happens if I don’t know how many sheets I have?
Is it possible to get a UDF to write data to the windows clipboard? That way you could run the function then paste it onto the sheet – if you see what I mean?
Good stuff
Ross
LikeLike
Ross – you don’t like array functions?
The point of the sheetname function was to get all the sheetnames listed in a column, so writing them to a column array seemed like the obvious way to do it.
I’ve never tried writing to the clipboard before, but looking into it, it seems to have interesting possibilities.
Everything you need to know here: http://www.cpearson.com/excel/Clipboard.aspx
The main thing being you need a reference to the Microsoft Forms 2.0 Object Library to make the code below work (I guess you’ll have that anyway, but I’ve just got a new computer and it didn’t have the reference set):
Function WriteToClip(Textin As String) as string
Dim mText As DataObject
Set mText = New DataObject
mText.SetText Textin
mText.PutInClipboard
WriteToClip = Textin & ” copied to clipboard”
End Function
LikeLike