View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
drinese18 drinese18 is offline
external usenet poster
 
Posts: 59
Default DAO Syntax Problem

I am trying to write a macro that will download a range of data from one
workbook to the next, but I am having some problems with my code, I am trying
to incorporate DAO within the code to be able to connect to the other
workbooks, but unfortunately it is not working. My DAO syntax kind of sucks
so bear with me, I hope someone can shed some light on this, some help will
be greatly appreciated:


Option Explicit

Private Sub CommandButton1_Click()
Dim rng1 As Range
Dim rngFound As Range
Dim rngCollector As String

'Dim Dest As DAO.Connection
'Dim Destination As DAO.Recordset

With Worksheets("Index")
Set rng1 = .Range("A1:A" & .Range("A65536").End(xlDown).Row)
End With
Set rngFound = rng1.Find(what:=DateValue(Me.TextBox1.Value))
Range(rngFound, rngFound.Offset(1, 8)).Copy
Destination =
Workbooks("CI-Adagio-History-Web.xls").Worksheets("Sheet1").Range("A65536").End (xlUp).Offset(1, 8)
Set rngFound = Nothing
Unload Me
End
End Sub