View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Blinkburg Blinkburg is offline
external usenet poster
 
Posts: 1
Default linking two workbooks with ODBC & the Excel Driver

Hi I am currently working on a custom function to retrieve data from some
lists held in a 'record' workbook to be placed in appropriate cells of a
'working' book.

I have been able to create the function however if a 'working' book is saved
without the appropriate info already in the record book the function does not
automaticaly update when this info goes in.

I think I need to use ODBC in the code but am unsure how to refernce this as
I only have sample code for ODBC use with a database driver??

Function SampleRef(FilterID, FilterSize)

GetSheet = "Filter" & FilterSize
GetArray = "Filter" & FilterSize & "FilterNo"

For Each Cell In
Workbooks("ControlFigures").Worksheets(GetSheet).R ange(GetArray)

CycleRef = Cell.Value

If FilterID = CycleRef Then

SampleRef = Cell.Offset(0, 17).Value

Exit For
Else: SampleRef = "#N/A"
End If
Next Cell
End Function