Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Oooppssss, my bad. Missed out that line. Code: -------------------- Dim strName As String Dim strPosition as String Dim objExcel As Object Set objExcel = CreateObject("ADODB.Recordset") Dim rsData as ADODB.RecordSet Set rsData = New ADODB.RecordSet -------------------- After I have opened the connection of the spreadsheet, all the data are stored in objExcel. After I have opened the connection to my database, all the data are stored in rsData which then will be used as filter. Code: -------------------- objExcel.MoveFirst Do While Not objExcel.EOF strPosition = objExcel.Fields("Position").Value rsData.Filter = "Position = ' " & strPosition & " ' " If Not rsData.EOF Then strName = objExcel.Fields("Name").Value End If objExcel.MoveNext Loop -------------------- -- marsulein ------------------------------------------------------------------------ marsulein's Profile: http://www.excelforum.com/member.php...o&userid=16064 View this thread: http://www.excelforum.com/showthread...hreadid=275204 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
To store the formula in a string | Excel Discussion (Misc queries) | |||
retrieving data from variable workbooks | Excel Discussion (Misc queries) | |||
Retrieving Cell Data From Variable Files | Excel Worksheet Functions | |||
Retrieving data from Excel and store it into string variable | Excel Programming | |||
Retrieving data from Excel and store it into string variable | Excel Programming |