Start by solving the problem on a sheet of paper. It's not an easy one, take the time you need to solve it.
Once you solved it, you work on representing the problem in terms of your programming language. It's the part where you build a model for your program to interact with. I don't know VB so I cannot give you a working code, but here are some ideas:
You're maintaining 2 arrays, wouldn't it be simple to just maintain one? Let me explain this using Python code (take a second to read this, even if you don't know Python. It's easier than you'd think):
money = ('50000', '20000', '10000', '5000', '1000', '500', '250', '100')
quantity = (30, 5, 10, 10, 100, 100, 100, 100)
money_and_quantity = (
('50000', 30),
('20000', 5),
('10000', 10),
('5000', 10),
('1000', 100),
('500', 100),
('250', 100),
('100', 100))
In the first 2 lines I create 2 different arrays to hold the money face value and the quantity. This is pretty annoying to maintain. It works, but it's going to be really annoying to deal with all these arrays if your program wants to grow. In the next line I create a single variable that is an array of elements that hold 2 values each. Each of these element is an array of size 2, representing the face value and the quantity of each bill. That's a cleaner representation.
Also, why do you recreate your arrays constantly? Can't you simply hold the info at a single place that's accessible to all?
Thinking about these 2 issues will help you manage the complexity in your code. Remember the point is to solve the problem on paper first. You cannot write code until you know what you're going to write.
More about the counting change problem
Here's
how that exercise is solved in SICP. The solution is used as an introduction to recursive algorithms.