LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Transferring Excel Spreadsheets into Access

This site might help you.

http://www.exceltip.com/se/subtotal.html

Sub ADOFromExcelToAccess()
' exports data from the active worksheet to a table in an Access database
' this procedure must be edited before use
Dim cn As ADODB.Connection, rs As ADODB.Recordset, r As Long
' connect to the Access database
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=C:\FolderName\DataBaseName.mdb;"
' open a recordset
Set rs = New ADODB.Recordset
rs.Open "TableName", cn, adOpenKeyset, adLockOptimistic, adCmdTable
' all records in a table
r = 3 ' the start row in the worksheet
Do While Len(Range("A" & r).Formula) 0
' repeat until first empty cell in column A
With rs
.AddNew ' create a new record
' add values to each field in the record
.Fields("FieldName1") = Range("A" & r).Value
.Fields("FieldName2") = Range("B" & r).Value
.Fields("FieldNameN") = Range("C" & r).Value
' add more fields if necessary...
.Update ' stores the new record
End With
r = r + 1 ' next row
Loop
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
End Sub


--
ca1358


"Nancy" wrote:

I work in a real estate brokerage firm. We need to transfer our
current excel based spreadsheet into Access. Our goal is to utilize
Access for superior Database Management while maintaining Excel's
calculator functions. Is this feasible? Also can this be done in an
HTML environment?


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transferring data between spreadsheets Traci P.[_2_] Excel Discussion (Misc queries) 1 December 13th 07 09:44 PM
Transferring data from MS Access to MS Excel Joe Excel Discussion (Misc queries) 2 April 5th 06 06:24 PM
Interactive spreadsheets for transferring info from 1 to another Susan Excel Worksheet Functions 1 January 25th 06 08:32 PM
Transferring Excel Spreadsheets into Access [email protected] Excel Programming 1 November 30th 05 04:44 PM
transferring data from access to excel dave Excel Programming 8 September 2nd 03 03:09 PM


All times are GMT +1. The time now is 03:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"