Hello:
I am trying to create a looping structure that finds a value and compares it to another value on two different spreadsheets using VBA.
I have already figured out how to push MS Access data to MS Excel into a blank sheet. I need to be able to loop through the data pushed to excel by the first column which is "JobNumber" and match it to a column (list) of job numbers on another sheet:
Output to Excel:
Sheet1
JobNum PartNum Reference Cost
110 ... ... $
229 ... ... ...
303 ... ... ...
Sheet2
JobNum
110
229
303
I realize that I can use "Match" or VLookup within Excel to bring back the values I need. However, I am creating other objects using VBA with this data; I'd like to keep it all within the IDE where possible.
I am familiar with recordsets and qdefs within MS Access. And essentially, I am trying to use JobNum as my criteria within a recordset in order to bring back the other field values I need.
I started learning about named ranges, but when I tried to Dim rs and create the loop, the problems began. Does anyone have any experience with this?
thanks,
Ben
I am trying to create a looping structure that finds a value and compares it to another value on two different spreadsheets using VBA.
I have already figured out how to push MS Access data to MS Excel into a blank sheet. I need to be able to loop through the data pushed to excel by the first column which is "JobNumber" and match it to a column (list) of job numbers on another sheet:
Output to Excel:
Sheet1
JobNum PartNum Reference Cost
110 ... ... $
229 ... ... ...
303 ... ... ...
Sheet2
JobNum
110
229
303
I realize that I can use "Match" or VLookup within Excel to bring back the values I need. However, I am creating other objects using VBA with this data; I'd like to keep it all within the IDE where possible.
I am familiar with recordsets and qdefs within MS Access. And essentially, I am trying to use JobNum as my criteria within a recordset in order to bring back the other field values I need.
I started learning about named ranges, but when I tried to Dim rs and create the loop, the problems began. Does anyone have any experience with this?
thanks,
Ben