Help combining macros
#1
Help combining macros
Help,
I am trying to combine some macros from the web,
First one to select a file, the next one to edit text within file (I have only pasted the first part here).
The problem is passing the chosen file name to the second macro, it is expecting a filename where I have added the ???????, How can I get the filename in there ??
Sub OpenOneFile2()
Dim fn As Variant
fn = Application.GetOpenFilename("log-files,*.log", _
1, "Select File To Open", , False)
If TypeName(fn) = "Boolean" Then Exit Sub
Debug.Print "Selected file: " & fn
ReplaceTextInFile ThisWorkbook.Path & _
"???????????", "read test status,", "read test status"
End Sub
Any ideas ??
I am trying to combine some macros from the web,
First one to select a file, the next one to edit text within file (I have only pasted the first part here).
The problem is passing the chosen file name to the second macro, it is expecting a filename where I have added the ???????, How can I get the filename in there ??
Sub OpenOneFile2()
Dim fn As Variant
fn = Application.GetOpenFilename("log-files,*.log", _
1, "Select File To Open", , False)
If TypeName(fn) = "Boolean" Then Exit Sub
Debug.Print "Selected file: " & fn
ReplaceTextInFile ThisWorkbook.Path & _
"???????????", "read test status,", "read test status"
End Sub
Any ideas ??
Thread
Thread Starter
Forum
Replies
Last Post
domu
ScoobyNet General
7
03 October 2015 03:46 AM