As rylo correctly pointed out, the advanced filter is preferable in this instance and is the route I took. Since you asked for code, I developed code. With that said, it's not entirely necessary.
**Disclaimer - I could not get the 'criteria' component of the advanced filter to work. Should someone point out the correct syntax, the for each loop I used would not be needed and the resulting code would be much simpler. (I take these on as puzzles, like others do suduko or crosswords).**
The following applies the advanced filter and sends the results to a temp worksheet. The resulting range is then analyzed for instances where the date entered in a named range in your workbook (which you will need to create) equals the date in the range. The corresponding Bill No. is then passed to the next available row in the original worksheet.
Always make a copy of your workbook and run the code on that copy. VBA can be difficult to undue and taking a few precautionary steps can save you a headache down the road. Please see my notes throughout for adjustment as needed.
Bookmarks