Importing Certain Excel Cells . . . What to do?

whoneeds8

New member
Local time
Today, 11:58
Joined
Jan 26, 2005
Messages
9
I want to import only the information from an excel sheet like the one below where the answers for Q1 and Q2 are No and Yes respectively.

excel.jpg


I'm using this code below that is working but importing all cells:
Code:
Private Sub Command31_Click()

DoCmd.TransferSpreadsheet acImport, _
acSpreadsheetTypeExcel9, "CustomerRecords", "C:\Documents and Settings\mstafford\Desktop\CustomerRecords.xls", True, "C1:I20"

End Sub

What do I need to add?
 
Last edited:
If you are asking how to import only rows 2, 5, 7 - you can't - unless you want to write code to automate excel. Import the whole sheet and then use a query to select just the rows you are interested in.
 
Pat Hartman said:
If you are asking how to import only rows 2, 5, 7 - you can't - unless you want to write code to automate excel. Import the whole sheet and then use a query to select just the rows you are interested in.


Duh, I'm an idiot. LOL . . . Thanks. :cool:
 
attach the Excel file as a lnked table,
then write an append query to append only the
records that you want. . .

sounds so simple, and it really is

sportsguy
 

Users who are viewing this thread

Back
Top Bottom