Hi VBA people,
I know that many advanced VBA users advocate getting away from using selects. It seems there are many work arounds. However, I have a project where a .select might be best. I would like to get the user community's feedback on how optimize and improve this process:
Thanks!
I know that many advanced VBA users advocate getting away from using selects. It seems there are many work arounds. However, I have a project where a .select might be best. I would like to get the user community's feedback on how optimize and improve this process:
Code:
' Copy the file's data
Workbooks.Open fileName:=fileSpec 'here I reference the fileSpec variable which calls a csv file's location
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
' Import the data
Windows("DataFile.xlsm").Activate
Sheets("Data").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Thanks!