Zain_inout
New Member
- Joined
- Sep 8, 2021
- Messages
- 18
- Office Version
- 2019
- Platform
- Windows
My code is written in my macro workbook. I have to work on a different file every time with the same steps. So ideally I need a macro in a macro file and my target files will be different. Below is a code I have in my macro file.
Sub EEBalanceSummary()
On Error Resume Next
Dim FilePath As String
FilePath = Application.GetOpenFilename
Range("B6").Select
End Sub
I run this code from my macro file. It asks me to select the folder and then the file I need to work on. Now, instead of selecting "B6" cell in my newly opened target file, it selects "B6" in the same macro file. How can I get the code to work on my target file?
Sub EEBalanceSummary()
On Error Resume Next
Dim FilePath As String
FilePath = Application.GetOpenFilename
Range("B6").Select
End Sub
I run this code from my macro file. It asks me to select the folder and then the file I need to work on. Now, instead of selecting "B6" cell in my newly opened target file, it selects "B6" in the same macro file. How can I get the code to work on my target file?