zensathish
New Member
- Joined
- May 28, 2019
- Messages
- 6
Hi All,
I am new to this forum and this is my first post.
I have multiple text files, which I am locating using
once the text files are located, I open it using
after I open the files, I move it to the current excel (excel name MC9.xlsm) using
Here the file name is hard coded as "MC9.xlsm". I need to know how to get the workbook name and assign it in the below code
Your support would be much appreciated.
Regards,
Zen.
I am new to this forum and this is my first post.
I have multiple text files, which I am locating using
Code:
Application.ActiveWorkbook.Worksheets
once the text files are located, I open it using
Code:
Workbooks.OpenText Filename:= _
sFolder & "/CONTRACT" _
, Origin:=xlMSDOS, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=False, Space:=False, Other:=True, OtherChar:="*", FieldInfo:= _
Array(Array(1, 5), Array(2, 1), Array(3, 1)), TrailingMinusNumbers:=True
after I open the files, I move it to the current excel (excel name MC9.xlsm) using
Code:
Windows("CONTRACT").Activate
Sheets("CONTRACT").Select
Sheets("CONTRACT").Move After:=Workbooks("MC9.xlsm").Sheets(2)
Here the file name is hard coded as "MC9.xlsm". I need to know how to get the workbook name and assign it in the below code
Code:
Sheets("CONTRACT").Move After:=Workbooks("MC9.xlsm").Sheets(2)
Your support would be much appreciated.
Regards,
Zen.