我有这个宏,当我输入部分和年份和月份时导入所需的工作表。 如何添加(从月份)和(到月份)以显示所需的工作表?
非常感谢
Sub macro()
Workbooks.Add
wb1 = ActiveWorkbook.Name
quantitiy_of_productions = "O:\LF\07M\JL\"
Section = ThisWorkbook.Worksheets("w1").Range("Section")
Year = ThisWorkbook.Worksheets("w1").Range("Year")
From_Month = ThisWorkbook.Worksheets("w1").Range("From_Month")
To_Month = ThisWorkbook.Worksheets("w1").Range("To_Month")
For i = 1 To 12
Filename = "QP_Sec" & Section & ".xlsx"
Workbook.Open Filename:=Quantity_of_productions & "QP" & Year & "\" & filename, ReadOnly:=True, IgnoreReadOnlyRecommended:=True
Workbooks(Filename).Close False
Next i