Dear Friends, I have searched and read many similar posts, but nothing currently fits for me. Your help will be greatly appreciated.
My code opens a directory allowing the user to select a file to work with. I need code that will copy the filename of wkb2 and paste it to the workbook ("FactoryDrawingConfig.xlsm") that holds the code.
code<>
'Opens the csv directory and shows files to select from
Dim wkb2 As Workbook
Dim Usersname As String
Usersname = Environ("USERNAME")
strFileName = "C:\Users\" & Usersname & _
"\Dropbox\PC\Documents\CapitalElement\FilesToConvert"
ChDir strFileName
FileFilter = "Excel 2003 (*.xls),*.xls," & _
"Excel 2007 > (*.xlsx),*.xlsx," & _
"All Excel Files (*.xl*),*.xl*," & _
"All Files (*.*),*.*"
strFileName = Application.GetOpenFilename(FileFilter, 4, "Select One File To Open")
Set wkb2 = Workbooks.Open(strFileName, False, False)
<>
My code opens a directory allowing the user to select a file to work with. I need code that will copy the filename of wkb2 and paste it to the workbook ("FactoryDrawingConfig.xlsm") that holds the code.
code<>
'Opens the csv directory and shows files to select from
Dim wkb2 As Workbook
Dim Usersname As String
Usersname = Environ("USERNAME")
strFileName = "C:\Users\" & Usersname & _
"\Dropbox\PC\Documents\CapitalElement\FilesToConvert"
ChDir strFileName
FileFilter = "Excel 2003 (*.xls),*.xls," & _
"Excel 2007 > (*.xlsx),*.xlsx," & _
"All Excel Files (*.xl*),*.xl*," & _
"All Files (*.*),*.*"
strFileName = Application.GetOpenFilename(FileFilter, 4, "Select One File To Open")
Set wkb2 = Workbooks.Open(strFileName, False, False)
<>