PDA

View Full Version : Cell Selection in Access



john-86
03-16-2006, 05:10 AM
This line is to import a table into Access:


DoCmd.TransferSpreadsheet acImport, 0, "GIS Import Table", "M:\John Gregson\Fishing Meids\GIS Element\Export_Output.xls", True, "A1:D5"



I can use Justin's 'browse for file' function to get the path of the table to be imported. I was wondering how to automate the cell selection. Basically, the function needs to look at A1, see that there's data, move to B1, then C1 until it finds a blank cell. Then go down the rows to find the limit there.

Can this be done in Access alone? Or would Excel have to be opened to determine the range?

Regards,
John

Norie
03-16-2006, 10:31 AM
John

If you don't specify a range then I think Access will probably only import the rows/cells that have data.

john-86
03-16-2006, 12:05 PM
See, sometimes I look for a complicated answer to a fairly simple question. Thanks Norie, I'll try it out tomorrow when I get to work.

Kind regards,
John