ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   linking two workbooks with ODBC & the Excel Driver (https://www.excelbanter.com/excel-programming/325947-linking-two-workbooks-odbc-excel-driver.html)

Blinkburg

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



All times are GMT +1. The time now is 10:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com