作者:ChiuChiuLIN | 来源:互联网 | 2023-06-28 13:50
In the current workbook, I want to make a list of the sheets ending in -A and -B and put them in the sheet called List
starting from cell C3
:
my code is:
在当前的工作簿中,我想列出以-A和-B结尾的工作表,并将它们放在名为List的工作表中,从单元格C3开始:我的代码是:
Sub Make_list_of_sheets()
Dim Sheet As Worksheet
For i = 1 To sheets.Count
If Sheet.Name Like "*" & strSearch & "-A" Or _
Sheet.Name Like "*" & strSearch & "-B" Then
Sheet(Sheet.Name).Count
sheets("list").Range("C3")(i, 1).Value = sheets(i).Name
End If
Next i
End Sub
Problem: the code is not working, its runs into error.
How to correct this code?
问题:代码无法运行,其运行错误。如何更正此代码?
1 个解决方案