01-05-2016 05:54 PM
I am working with a few macros I inherited that import data from Excel workbooks. Currently, it is required to manually input the RANGE of each sheet to define import data range. I was wondering if there is a way to automatically find the "last cell" that contains content in a sheet. As far as I understand the file is read in line by line, so once there is no content in the next line it should be able to say row 100, column X is the last cell with content.
The goal is to identify the cell "X100" to automatically import it without having to open the file and looking for the last cell with content.
%Let Excel1Sheet1Range = 'A2:X100'; PROC IMPORT DATAFILE= &Excel1 DBMS=EXCELCS OUT=Sheet1 REPLACE; SHEET='Sheet1'; RANGE=&Excel1Sheet1Range; SCANTEXT=YES; USEDATE=YES; SCANTIME=YES; RUN;
01-05-2016 06:10 PM
Proc import has very little control available.
You may want to check if the LIBNAME XLXS works for you.
Some helpful hints
01-05-2016 06:15 PM