Hi all,
I have a macro that asks the user to select a file then with an input box they choose a range to copy.
They will generally select (separately) up to 5 files across different locations to import data from.
As a check process and to reduce errors I would like the ability for the user to keep track of which files they have already imported.
My pretty lame attempt at this is below:
How would you copy the file name of the active workbook into a cell of the targetsheet?
I understand that I am missing a step or two for copying the filename (I use "filename" as a string earlier on) but everything I have played around with so far just ends up running the error handler of the wider code with no successful importing of the filename - hence the "blank" canvas.
Any help would be greatly appreciated!
I have a macro that asks the user to select a file then with an input box they choose a range to copy.
They will generally select (separately) up to 5 files across different locations to import data from.
As a check process and to reduce errors I would like the ability for the user to keep track of which files they have already imported.
My pretty lame attempt at this is below:
Code:
customerWorkbook.Activate
activeworkbook.Name
targetSheet.Activate
emptyColumn = targetSheet.Cells(1, targetSheet.Columns.Count).End(xlToLeft).Column + 1
With targetSheet
.Cells(emptyColumn, 1).Select
.Paste
End With
I understand that I am missing a step or two for copying the filename (I use "filename" as a string earlier on) but everything I have played around with so far just ends up running the error handler of the wider code with no successful importing of the filename - hence the "blank" canvas.
Any help would be greatly appreciated!