Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel copy data then paste into Access

Status
Not open for further replies.

tqeonline

MIS
Oct 5, 2009
304
US
Hello everyone,

I'm new here so hopefully I can be helped!

I currently have a list in excel that i'd like to copy selected data from excel into access.

Ex.
Code:
Sub Part_Pull_Check_Out()
Dim x As Integer
Dim a, e, g, an, en, gn As String

finish = Range("a" & ActiveSheet.Rows.Count).End(xlUp).Row - 2
For x = 4 To finish
    If Len(Range("a" & x)) = 5 Then
        a = Range("a" & x)
        an = Range("d" & x)
    End If
    If Len(Range("e" & x)) = 5 Then
        e = Range("e" & x)
        en = Range("f" & x)
    End If
    If Len(Range("g" & x)) = 5 Then
        g = Range("g" & x)
        gn = Range("h" & x)
    End If
    AppActivate "Microsoft Access"
    ***paste A, tab, delete, paste an, tab, tab***
    ***paste E, tab, delete, paste en, tab, tab***
    ***paste G, tab, delete, paste gn, tab, tab***
next x
End Sub

As you can see I don't know what to do in that *** *** area. Only two applications that are open are excel and access.

Is this possible?
 
Pasting into Access can be problematic at best because Access has column types and Excel does not. I find it easier to write your data to a file then import it into Access.

Simi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top