Hello,
I open a blank excel file and go through the below code. The code works just fine until it get to (ActiveSheet.Range("$A$1:$M$1048576").AutoFilter Field:=1, Criteria1:="="). When excel gets to this line it actually performs this code on the original blank file instead. I think it does because the line says activesheet. How do keep excel from going to blank excel file and perform the sequencing code on the file that was opened?
Thanks in advance for your help.
Zohaib
I open a blank excel file and go through the below code. The code works just fine until it get to (ActiveSheet.Range("$A$1:$M$1048576").AutoFilter Field:=1, Criteria1:="="). When excel gets to this line it actually performs this code on the original blank file instead. I think it does because the line says activesheet. How do keep excel from going to blank excel file and perform the sequencing code on the file that was opened?
Thanks in advance for your help.
Zohaib
Code:
Sub test_fileopen()
Dim filename
filename = Application.GetOpenFilename
If filename <> False Then
Workbooks.Open (filename)
MsgBox "Continue"
' add your code here
ActiveSheet.Name = "Submission Review"
End If
End Sub
Last edited: