Hello,
I already have a macro that will open a file, the name of which is specified in cell A3 of my workbook (as it is subject to change). Now I just need my macro to activate the newly opened workbook at various points later on in the code. This is the code I have so far...
Dim strFName As String
strFName = ThisWorkbook.Worksheets("Upload Sheet").Range("B6").Value
'this variable contains the workbook name and path
If FileExists(strFName) Then
'does it exist?
If Not BookOpen(Dir(strFName)) Then Workbooks.Open Filename:=strFName
'if its not already open, open it
Else
MsgBox "The file/location specified does not exist!"
End If
All I need now is to activate strFName basically, but I'm not sure of the code?
Many thanks for your help!
Bookmarks