Excel workseet range as import or save as text file

I am trying to design a database that import in a range of cells/rows from an Excel worksheet to then do some processing on this data.

How can I just grab a range of cells/rows for my database to then 'clean up' that data?

For instance, I need A9 to BB49.

This question is simply for grabbing that data.....
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kyle AbrahamsSenior .Net DeveloperCommented:

To select the range:

Full export here:


Sub testexport()
     ' export Macro
Dim Dir as String = "C:"
    ActiveWorkbook. SaveAs Filename:= _
    Dir + "\Test.csv" _
    , FileFormat:=xlCSV, CreateBackup:=False
    Application.DisplayAlerts = False
    Application.DisplayAlerts = True
End Sub
scbdpmAuthor Commented:
My apologies, I thought I had only chosen Access at topic area.

Not interested in doing it within my Excel worksheet, just the access database.
Jeffrey CoachmanMIS LiasonCommented:
Select the range in Excel
Then copy it.
Then open Access and paste into the Database window or Navigation Pane.
Acronis Data Cloud 7.8 Enhances Cyber Protection

A closer look at five essential enhancements that benefit end-users and help MSPs take their cloud data protection business further.

Rey Obrero (Capricorn1)Commented:
<This question is simply for grabbing that data...>
do you want to do this using VBA codes ?
Jeffrey CoachmanMIS LiasonCommented:
In order to "really" do this you have to open an instance of Excel, in Access.
Then do pretty much the same thing as ged325 posted (Only from Access)

I am sure capricorn1 will be able to help you with the exact code.

Jeffrey CoachmanMIS LiasonCommented:
<No points wanted for my posts>
Do you want the data linked or just to grab it once?  If you're doing it on one range or Excel sheet to one Access table, you can simply use External Data - Excel - and then link or import depending on which you need.  From there, you select the worksheet or range, whether or not the first row contains headings, and add a primary key if necessary.
Rey Obrero (Capricorn1)Commented:

what version of office are you using?
Kyle AbrahamsSenior .Net DeveloperCommented:

SELECT T1.*, 1 AS SheetSource
FROM [Excel 8.0;HDR=YES;IMEX=1;Database=C:\MyFolder\MyFile.xls].[WorksheetName$A9:BB49] as T1;
scbdpmAuthor Commented:
capricorn1- Office 2010
Rey Obrero (Capricorn1)Commented:
try this command

docmd.transferspreadsheet acimport,10, "TableName","C:\folderName\ExcelFile.xlsx",False,"NameOfSheet!A9:BB49"

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.