+ Reply to Thread
Results 1 to 2 of 2

pull data, text box with file name

Hybrid View

  1. #1
    Registered User
    Join Date
    09-02-2008
    Location
    Richmond
    Posts
    71

    pull data, text box with file name

    I need to input the file name into the text box "DRAW082808" this will look in a folder for that file name

    then the macro below looks for

    Home Delivery and (123060) in the next colum
    and College routes and (627), Carrier Copy ((845) and adds these together and inserts in a cell on the masterfile under Home Delivery

    Private Sub Thisyeardraw_Click()
    Set sn = CreateObject("adodb.connection")
      Set rs = CreateObject("adodb.recordset")
      sn.Open "provider=microsoft.jet.oledb.4.0;data source = m:\cir at a glance\dsi reports\" & TextBox3.Value & ".xls;extended properties = ""Excel 8.0; HDR=yes"""
      
      sqlstr = "select sum(col1_copies) from [" & TextBox3.Value & "$] where col1_head = Home Delivery 
      rs.Open sqlstr, sn
      Range("c42").CopyFromRecordset rs
      rs.Close
       
       
      Set rs = Nothing
      Set cn = Nothing
    End Sub

    Home Delivery "123060" + "627" + "845"

    School "240" + "1133"

    Mail "679"

    3rd Party "10555"


    I have attached the master file and the two files to pull from
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    09-02-2008
    Location
    Richmond
    Posts
    71

    Exclamation Help

    Help please anyone

+ 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