Sub GetSheetConfigWithFilter()
Dim ws As Worksheet
Dim nm As Name
Dim sheetName As String
Dim nmName As String
Dim cellValue As Variant
Dim outputText As String
Dim filePath As String
' 初始化字符串变量
outputText = ""
' 设置文件路径(根据需要修改)
filePath = "E:\output.txt"
' 遍历所有的工作表
For Each ws In ThisWorkbook.Sheets
sheetName = ws.Name
' 遍历当前工作表的所有名称管理器
For Each nm In ws.Names
If nm Is Nothing Then
a = 1
Else
' 获取名称管理器的名称
nmName = nm.Name
' 移除sheet名,并检查名称是否以 "Mark_" 开头
Dim sheetDelimiter As String
sheetDelimiter = IIf(InStr(1, nmName, "'") > 0, "'", "")
Dim nameWithoutSheet As String
nameWithoutSheet = Mid(n
vba遍历工作簿的所有工作表和名称管理器输出及单元格名称
于 2024-01-03 17:44:02 首次发布