jessmendez01
05-04-2016, 01:00 PM
Below is the code i have where it opens from my directory and opens a workbook...i need that file name and path to report back to my 4-26-16 testing2.xlsm file in column A
What am i doing wrong b/c it's not doing it
Option Explicit
Sub Filename()
Dim originalFile As String
Dim NewFile As String
originalFile = ActiveWorkbook.name
NewFile = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls*), *.xls", Title:="Please select a file", MultiSelect:=False) 'only excel files
Workbooks.Open NewFile
NewFile = Dir(NewFile)
ActiveCell = ActiveWorkbook.FullName
Range("A" & ActiveCell.Row).Select: Workbook "4-26-16 testing2.xlsm"
End Sub
What am i doing wrong b/c it's not doing it
Option Explicit
Sub Filename()
Dim originalFile As String
Dim NewFile As String
originalFile = ActiveWorkbook.name
NewFile = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls*), *.xls", Title:="Please select a file", MultiSelect:=False) 'only excel files
Workbooks.Open NewFile
NewFile = Dir(NewFile)
ActiveCell = ActiveWorkbook.FullName
Range("A" & ActiveCell.Row).Select: Workbook "4-26-16 testing2.xlsm"
End Sub