Workbook that I need help with: http://www.hgs-auditing.com/ExampleCode.xls
Ok, I have uploaded an example of my program. My questions today are in regards to the code in Module1, sub FillSectionCategory.
The purpose of this code is to assign a Section # and Category # to each line in worksheet "Detail Import". When freshly imported, the this sheet does not have any data in the yellow fields. It aquires this information from the next worksheet, and the code. Each line in "Detail Import" has a Reference Number. What this code does is look at worksheet "Detail Import (Section-Category" and go through each line. The first line says that References 00319 - 00328 are Section 1, Category 1. So then it goes to the first worksheet and go to row 320 (due to the beginning Reference number, 319 + 1 row due to the header row), and places the corresponding Section/Category.
So lets make sure this is clear: It matches up Refererence numbers using the digits in "Detail Import (Section-Category" to the ROW number in "Detail Import", NOT to the reference number assigned to the line. This works out 95% of the time because the Reference numbers are in numerical order in Detail Import. So for example, if the code needs to place a Section/Category in Reference 432, it looks at row 433 (which most of the time will be correct...row 433 will have a Reference number of 432.
The problem now is sometimes the reference numbers in "Detail Import", some are not used. So it could go:
00001
00002
00003
00007
00008
00009
If Reference 00008 is supposed to have a certain Section/Category, because of the way the code is written right now, it will not match up Reference numbers...it will place data in its corresponding ROW, and not find the reference number to match.
How can I modify this code so that instead of finding a row number, it finds a Reference number (Range B in Detail Import).
Thanks
Bookmarks