Simple 'Dispensing' program

peteprp

New Member
Joined
Jun 9, 2018
Messages
26
Hi all,
I want to create a very simple dispensing program. I have an excel listing of medications - see below. I want to be able to do a 'wildcard' search for a particular medication and then be able to enter the quantity dispensed. The quantity dispensed should be added to the cumulative total dispensed for that particular medication. At the end of the day or week, I'd like to be able to see & download/copy the total amount dispensed for each medication.

DRUG NAMEUNITS
Aluminium Chlorohydrate Cream 20%Ea
Aluminium sulphate Solution 20% Spray 25mLEa
Amethocaine Mimum 0.5% 20'sPer Minum
Aminophylline Amps 250mg/10mlPer Amp
Amiodarone Inj 150mg/3mLPer Amp
Amlodipine Tabs 10mgPer Tab
Amoxycillin 100mg DrpsEa
Amoxycillin 400mg, clavulanate 57mg Syr Ea
Amoxycillin 875mg, clavulanate 125mg Tabs Per Tab
Amoxycillin Amps 1gmPer Vial
Amoxycillin Caps 250mgPer Caps
Amoxycillin Caps 500mg Per Caps
Amoxycillin Syrup SF 125mg/5ml Ea
Amoxycillin Syrup SF 250mg/5ml Ea
Antazoline/ Naphazoline Eye Drops Ea
Aqueous Cream 100g creamEa
Artesunate Inj 60mgPer Vial

<tbody>
</tbody>

Search Drug Name:
For example, type in amox 25 c

<tbody>
</tbody>

Then show result below together with Units column & add
the number of capsules dispensed in the column alongside
Enter Number Dispensed
Amoxycillin Caps 250mgPer Caps
5

<tbody>
</tbody>

If anyone can help, I would really appreciate it. Is it possible to do this without using a macro?
Thank you.
Pete
 
My reply edit timed-out so I lost what I'd written down.
If you click the 'Remember Me?' box when you sign in, that shouldn't happen.


.. the first question was whether it would be possible for the cursor to return to cell C3 (SearchText) after having entered the amount dispensed for the particular medication?
That one is easy, just add the blue line of code where shown near the bottom of the existing code.
Rich (BB code):
Range("SearchText").ClearContents '<- Delete if not required
Range("SearchText").Select

I didn't understand the second question.
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
If you click the 'Remember Me?' box when you sign in, that shouldn't happen.

Thank you for the tip here.


That one is easy, just add the blue line of code where shown near the bottom of the existing code.
Rich (BB code):
Range("SearchText").ClearContents '<- Delete if not required
Range("SearchText").Select

That works perfectly.Thank you.

I didn't understand the second question.

OK, sorry, I’ll try &explain it better - currently I have 2 tabs in the workbook. One tab is the'Dispense' Tab for which you have kindly written the code. The second tab containsthe Master Stock File. The Master Stock file has other information about eachmedication such as product code, trade name, total stock on hand, number perpack, price etc. So the ‘Dispense’ Tab actually references the Master Stockfile, ie cell A4 is actually ‘=MASTER STOCK SHEET’!B5.
The cumulative totals from the ‘Dispense’ tab are copied tothe ‘Master Stock Sheet’ Tab as the total quantities dispensed for eachmedication & these amounts are subtracted from the stock on hand to give theactual stock on hand for each medication.
I would really liketo add an additional 3 tabs to the workbook – one each for ‘Stock Received’, ‘ExpiredStock’ & ‘Stock Adjustment’. Each of these spread sheet tabs would ideallybe in exactly the same format as the ‘Dispense’ tab. So, for example, thecumulative totals from the ‘Stock Received’ tab would be added to the stock onhand in the ‘Master Stock Sheet’.
I have tried to add these spread sheet tabs to the workbook bycopying the ‘Dispense’ Tab but the code does not work for anything other thanthe ‘Dispense’ Sheet.
I hope this is a better explanation but let me know if youhave other queries.
So, the big question is – would it be difficult to get thecode to work for the 3 additional tabs? I have no idea what’s involved and if itstoo big a job to get the code working for the additional spread sheet tabs thenplease don’t worry.
Thank you very much for all the time you have spent on this thusfar. I really do appreciate it.
 
Upvote 0
If I copy the Dispense tab, for me the code works exactly the same on the copied tab.

The cumulative totals from the ‘Dispense’ tab are copied tothe ‘Master Stock Sheet’ Tab
How?
Wouldn't that just be a formula (VLOOKUP or INDEX/MATCH) on the ‘Master Stock Sheet’ Tab? And so could you use a similar formula to get the totals from the new tabs too?
 
Upvote 0
If I copy the Dispense tab, for me the code works exactly the same on the copied tab.

OK. I'll have play with it and try again.

How?
Wouldn't that just be a formula (VLOOKUP or INDEX/MATCH) on the ‘Master Stock Sheet’ Tab? And so could you use a similar formula to get the totals from the new tabs too?

I did it the simple way - using '=DISPENSE STOCK'!D4 etc. I'll have to look into VLOOKUP or INDEX/MATCH as I'm not familiar with them.
I'll let you know how I go. Thanks again.
 
Last edited:
Upvote 0
Well, thank you. I got the additional tabs/sheets to work perfectly. I've also had a resonable look at VLOOKUP & INDEX/MATCH but, up until now, I'm struggling to understand them. I'll do more homework on them. I'm now at the stage where the workbook is working really well, thanks to all your efforts. I would like to progress on a few ideas and may, if that's OK with you, make contact again next week. Thank you again for all your help.
 
Upvote 0
Well, thank you. I got the additional tabs/sheets to work perfectly. I've also had a resonable look at VLOOKUP & INDEX/MATCH but, up until now, I'm struggling to understand them. I'll do more homework on them. I'm now at the stage where the workbook is working really well, thanks to all your efforts.
Good news. You are welcome.


I would like to progress on a few ideas and may, if that's OK with you, make contact again next week. Thank you again for all your help.
Unless the new questions are very closely related, you would be best to start a new thread. There won't be a lot of new readers of this thread now that it has >30 posts so you would be restricting the number of people who might help. :)
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,936
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top