|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
用select case来根据不同工作薄的名字判断是否符合要求然后进一步操作,下面关于select case表达哪里不规范啊,为什么总是执行不到红色区域的代码?
Public Sub generate_value()
Dim rng As Range
Dim taskc As Integer, vv As Integer
Dim str As String, wb As Workbook
str = Dir(ThisWorkbook.Path & "\*GCI(MY)*.xlsx")
Do
Set wb = Workbooks.Open(ThisWorkbook.Path & "\" & str, UpdateLinks:=False)
Select Case wb.Name
Case wb.Name Like "*DIGI-GU*" Or wb.Name Like "*DIGI-LTE*"
Sheet1.Activate
Rows(2).AutoFilter
End Select
str = Dir
Loop Until str = ""
End Sub
|
|