08-19-2022 09:43 AM
Hi,
This is probably not something I can do. But I was wondering if it's possible to automatically lable a tab in excel witht he name of the cube view I download? It would be a great time saver when I'm dowloading multiple cube vews or creating a book. I haven't been able to find anuthing in the Academy site on that.
Thanks in advance
08-24-2022 02:34 PM
Hi Steve,
If you don't mind running a macro, this one seems to do the trick...
A couple of things to note...
Good luck!
Sub CubeViewSheetNames()
Dim x As Integer
Dim sCubeView, WktName As String
Dim Ws As Worksheet
For Each Nm In ActiveWorkbook.Names
i = i + 1
If Left(Nm.Name, 9) <> "QuickView" And Right(Nm.Name, 10) = "_UpperLeft" Then
'If Right(Nm.Name, 10) = "_UpperLeft" Then
x = InStr(Nm.Name, "_UpperLeft")
If Left(Nm.Name, 1) = "_" Then
sCubeView = Mid(Nm.Name, 2, x - 2)
Else
sCubeView = Mid(Nm.Name, 1, x - 1)
End If
WktName = Range(Nm).Parent.Name
Set Ws = Worksheets(WktName)
Ws.Name = sCubeView
End If
Next Nm
End Sub