+ Reply to Thread
Results 1 to 3 of 3

Import Data into Current Workbook

Hybrid View

  1. #1
    Registered User
    Join Date
    04-21-2008
    Posts
    11

    Import Data into Current Workbook

    Hi! I'm trying to import data in to an existing workbook. When i run the macro in the existing workbook, a new workbook opens and the data is dropped there. What do i need to change to get the data to pull back in to the existing workbook? Any help would be very appreciated!!

    Thanks...


    Sub Pull_Accruals()
    '
    ' Pulls current month accruals
    '
    
    '
        Workbooks.OpenDatabase Filename:= _
            "F:\My Documents\My Data Sources\crp840 Finapp ExpenseBudgets$Export.odc", _
            CommandText:=Array("""Finapp"".""dbo"".""ExpenseBudgets$Export"""), _
            CommandType:=xlCmdTable, ImportDataAs:=xlTable
           
        
        ActiveSheet.ListObjects("Table_crp840_Finapp_ExpenseBudgets_Export").Range. _
            AutoFilter Field:=1, Criteria1:="ACCRUAL"
        ActiveSheet.ListObjects("Table_crp840_Finapp_ExpenseBudgets_Export").Range. _
            AutoFilter Field:=3, Criteria1:="2008"
        ActiveSheet.ListObjects("Table_crp840_Finapp_ExpenseBudgets_Export").Range. _
            AutoFilter Field:=2, Criteria1:="10"
        ActiveSheet.ListObjects("Table_crp840_Finapp_ExpenseBudgets_Export").Range. _
            AutoFilter Field:=6, Criteria1:=Array("820201", "820202", "820203", "820204", _
            "820205", "820206", "820207", "820208"), Operator:=xlFilterValues
        ActiveSheet.ListObjects("Table_crp840_Finapp_ExpenseBudgets_Export").Range. _
            AutoFilter Field:=7, Criteria1:="44505"
    
    
    End Sub
    Last edited by mrlevcik; 11-20-2008 at 12:02 PM.

  2. #2
    Registered User
    Join Date
    04-21-2008
    Posts
    11
    Hi! Still hoping for a response. Is there anything I can add to help clarify the question? I'm using Excel 2007.

  3. #3
    Registered User
    Join Date
    04-21-2008
    Posts
    11

    Found a work around

    I pull the data back in to a pivot table...which works out better as far as how my data is organized and used.




    P.S. I looked to see how to mark this as solved and couldn't find it...sorry...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1