Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 14th, 2005, 07:43 AM
Registered User
 
Join Date: Apr 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Moving data from Excel to Access

Hi all
I would like to add a button to an Excel spreadsheet that will read data from several (non-contiguous) cells and copy that data into the next available row in a pre-defined and constructed Access database.
Any help with this would be appreciated
Cheers
Chris

 
Old April 14th, 2005, 12:13 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Once you have your data, you can build it into an SQL string, and append it to the table with the something like the following:
Code:
Sub Whatever()

    Dim db     As Database
    Dim strSQL As String

    ' Define SQL statement for action query.
    strSQL = "INSERT INTO tblMAIN (   Fld1, Fname) " & _
             "VALUES              ('Stuff', 'Bob')"

    Set db = OpenDatabase("MyDB.mdb")
    db.Execute strSQL

End Sub





Similar Threads
Thread Thread Starter Forum Replies Last Post
Data transfer from Access to Excel swaroop Access VBA 2 June 1st, 2007 10:30 AM
Data from excel to access Vision G Access 3 June 14th, 2006 09:05 AM
Converting excel data to Access using excel VBA ShaileshShinde VB Databases Basics 1 April 26th, 2006 07:57 AM
Sending data from Access to Excel NovieProgrammer Access VBA 4 April 1st, 2005 10:48 PM
retrieving data in excel from access. yesilkalem Access 1 May 25th, 2004 04:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.