Hello Forum,
i would need your inputs related to a VBA code:
the background is as follows - i have a text file that i need to automatically perform text to column operation. I have recorded the macro to do so but the problem is that it saves the file in a diferent excel file.
what i would need to do when i'm opening the excel (main file.xlsm) file and run the macro is to:
- prompt me the browse window so that i can choose the folder where the text file is located and then select the file
- perform the text to column code and display the results in sheet2 in the current excel file (main file.xlsm)
please find below the code I've recorded. any input on how to change it in order to performed the above mentioned actions would be highly appreciated
i would need your inputs related to a VBA code:
the background is as follows - i have a text file that i need to automatically perform text to column operation. I have recorded the macro to do so but the problem is that it saves the file in a diferent excel file.
what i would need to do when i'm opening the excel (main file.xlsm) file and run the macro is to:
- prompt me the browse window so that i can choose the folder where the text file is located and then select the file
- perform the text to column code and display the results in sheet2 in the current excel file (main file.xlsm)
please find below the code I've recorded. any input on how to change it in order to performed the above mentioned actions would be highly appreciated
Code:
Workbooks.OpenText Filename:= _
"C:\Documents and Settings\730001108\Desktop\Stapples\AR GE Stuttgard\opde120511.txt" _
, Origin:=65001, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array( _
Array(0, 1), Array(6, 1), Array(33, 1), Array(36, 1), Array(57, 4), Array(66, 4), Array(76, _
1), Array(85, 1), Array(92, 1), Array(107, 1), Array(123, 1), Array(128, 1)), _
TrailingMinusNumbers:=True