Hi,
Thanks for all your support till now
This time i have a different problem
I need a macro, which will list down the name of tabs which is in a work book in another another work book sheet.
I found a macro, which will list down that in the same workbook using a formula =sheetname
But I need the same formula to be used in another workbook, may be using the same formula.
Please helpPHP Code:
Function SHEETNAME(Optional ShtOrder As Long = 0, _
Optional ByVal IncludeHiddenSheet As Boolean = False) As Variant
'// Developed by Kris @ ExcelFox.com
Dim ShtCount As Long
Dim i As Long
Dim n As Long
ShtCount = ThisWorkbook.Worksheets.Count
If ShtOrder = 0 Then
SHEETNAME = ActiveSheet.Name
Exit Function
End If
SHEETNAME = CVErr(xlErrRef)
Application.Volatile
With ThisWorkbook
If IncludeHiddenSheet Then
If ShtOrder > ShtCount Then Exit Function
SHEETNAME = .Worksheets(ShtOrder).Name
Else
For i = 1 To ShtCount
If .Worksheets(i).Visible = -1 Then
n = n + 1
If n = ShtOrder Then
SHEETNAME = .Worksheets(i).Name
Exit Function
End If
End If
Next
End If
End With
End Function
Bookmarks