Each of my worksheets have a two part name (Division).(Purpose), such as Domain.Switchboard
I've been trying to get the first part of the name (Domain) before the separator "." and separately the second part (Purpose) after the separator ".".
I've tried formulas I have for this purpose; they work fine on individual worksheets but the VBA debugger gets mad at 'filename'.
My latest attempt is to increase the array from 4 to 6 as in SbG.Cells(rG, CodeNameClmG).Resize(, 4).Value = Array(WsG.CodeName, WsG.Name, WsG.Index, WsG.Visible, WsG.Division, WsG.Purpose) but I don’t know what to use in WsG.Division & WsG.Purpose
With this latest attempt I even Dim As String both Domain & Purpose but NNNNNNOOOOOO
Help will be appreciated with this or point me in correct path.
This code I'm sending doesn’t include some of these changes because with those changes the results disappear. The picture is from before those changes.
I've been trying to get the first part of the name (Domain) before the separator "." and separately the second part (Purpose) after the separator ".".
I've tried formulas I have for this purpose; they work fine on individual worksheets but the VBA debugger gets mad at 'filename'.
My latest attempt is to increase the array from 4 to 6 as in SbG.Cells(rG, CodeNameClmG).Resize(, 4).Value = Array(WsG.CodeName, WsG.Name, WsG.Index, WsG.Visible, WsG.Division, WsG.Purpose) but I don’t know what to use in WsG.Division & WsG.Purpose
With this latest attempt I even Dim As String both Domain & Purpose but NNNNNNOOOOOO
Help will be appreciated with this or point me in correct path.
This code I'm sending doesn’t include some of these changes because with those changes the results disappear. The picture is from before those changes.
VBA Code:
Cells.Range("D5:G104").ClearContents
Const SwitchBoardName As String = "general.misc"
Const FilterCell As String = "b5"
Const OutputRow As Long = 5
Const IndexClm As String = "c"
Const NameClm As String = "d"
Const VisibleClm As String = "h"
Const CodeNameClm As String = "e"
Dim Sb As Worksheet
Dim Flt As String
Dim TabNames() As String
Dim r As Long
Dim ws As Worksheet
Dim rng As Range
Set Sb = ThisWorkbook.Worksheets(SwitchBoardName)
Flt = Sb.Range(FilterCell).Cells(1).Value
ReDim TabNames(ThisWorkbook.Worksheets.Count)
r = OutputRow
[e4] = [{"Name"}]
[f4] = [{"CodeName"}]
[d4] = [{"Index"}]
[g4] = [{"Visibility"}]
[l1] = [{"Restricted Worksheets"}]
[H4] = [{"Division"}]
[I4] = [{"Purpose"}]
''''order by [index] accending by Fluff @ Mr Excell
For Each ws In ThisWorkbook.Worksheets
If InStr(1, ws.Name, Flt, vbTextCompare) = 1 Then
Sb.Cells(r, NameClm).Resize(, 4).Value = Array(ws.Index, ws.Name, ws.CodeName, ws.Visible)
r = r + 1
End If
Next ws
If r Then
Set rng = Sb.Range(Sb.Cells(OutputRow, NameClm), Sb.Cells(r - 1, NameClm))
With Sb.Sort
With .SortFields
.Clear
.Add Key:=rng.Cells(1), _
SortOn:=xlSortOnValues, _
Order:=xlAscending, _
DataOption:=xlSortTextAsNumbers
End With
.SetRange rng
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With