我有一个带有宏的活动工作簿,它必须打开另外两个工作簿并将其设为活动工作簿。但包含宏的工作簿仍为活动工作簿。请帮忙。
With myFile
.Title = "Choose File"
.AllowMultiSelect = False
If .Show <> -1 Then
Exit Sub
End If
SF = .SelectedItems(1)
SF = Application.GetOpenFilename(SF)
MsgBox SF
Workbooks.Open Filename:=(SF)
wb1 = ActiveWorkbook.FullName
MsgBox "SF" & SF
MsgBox "WB1" & wb1
WB1 显示包含宏的工作簿的路径。非 SF(从 openfile 对话框中选择的源文件)
此外,下面的代码是否正确?
For Rw = 4 To DF.Sheet1.UsedRange.Rows.Count
For Rw1 = 3 To SF.Sheet1.UsedRange.Rows.Count
If df.Sheet1.Cells(Rw, 1).Value = sf.Sheet1.Cells(Rw, 53).Value Then
提前致谢