Using VBA with Checkboxes and vLOOKUP? - excel

I'm trying to make a small info sheet that has a drop down menu with a bunch of names. When you pick a name it automatically fills out a bunch of info on them. I also want it to have a checkbox that is checked if that person has a job. The problem I'm having calling/saving that value.
I'm trying to make it so all the saved information is on a second hidden sheet. Calling the information is easy enough. But changing it and having it save over what was previously there seems really hard.

Well, in the hidden sheet you should reserve one column with all the names and another column with two values that tells wether the person has a job or not, so say either 1/0 or Y/N.
The checkbox click/change event is what causes the column with the Y/N values to change. So I would just simply change the relevant value in the column that has al the Y/N values.

Related

Double-column DropList / ComboBox in Excel cell without VBA or Form?

Is there a way in Excel to create DropLists that display 2 columns intead of 1?
I know this can be done in VBA via a Form, but I do not want this file to be macro-enabled and even less to have to resort to a Form; I want the list to be in a cell and to have a whole column with these lists (like a column-wide Data Validation).
Assuming this is impossible, here's the workaround I implemented: I created a third column being a join/concat of the other two, so that my DropList shows both column info at the same time.
The small drawback is that when processing the selected value, I need to get only the part I need.
For instance, if my columns are "ID" and "Name", I display "Name [ID]" in the list, and when I retrieve the selected list value to process it in a formula, I get the text between [square brackets] so that I can use the unique identifier while allowing the user to choose a meaningful name in the list instead of an ID they know nothing about.

Data Validation without Drop Down List

I'm wondering if it is at all possible to use Data Validation in Microsoft Excel (2007) without creating a Drop Down list.
I'm currently creating a seating plan for work. I want the user to have the ability to freely type in the name in a cell (Desk). There are 7 teams of approximately 10-12 people. so finding a name in a long list would take up too much time. however the name typed in the cell has to be be an exact match from a list stored else where in the spreadsheet. The reason for this is i use a formula to show if everyone has been seated or not.
if a name is typed in and its not an exact i would like for an error message to pop up.
Any ideas if this is even possible?
im open to VBA. but a complete noob when it comes to VBA.
Thanks in advance.
Tom
To get DV without the drop-down, use the Custom > Formula option. Here is an example:
Only the set defined by the formula will be accepted and no drop-down will appear when the cell is clicked.

Data entry user form, copy paste with variation data

I'm working on a user form in excel vba. The purpose of the user form is to make data entry more efficient. The data that is being entered is for shoe products. Basically a "parent" of the data is made in one row. The proceeding rows, or what I refer to as children/variations, have the exact same data except certain fields(columns) will be variations of the parent and each variation will have a unique identifier.
For example: say we're entering data for "shoe123". The parent data would be like this
Title Sku
Shoe123 S123
Then the children would be in the row underneath with the same data except the variation size will be tagged at the end of some fields as well as a unique identifier for each variation. Theyd look something like this.
Title Sku
Shoe123 10.5 s123 10.5
Shoe123 11 s123 11
Uniqueid
09876543311
09876543321
So at this point I have been able to enter all the parent data in the form and transfer it to the appropriate column. I'm trying to figure out two things.
How can I code the user form to allow the user to enter the number of variations to create? and then based on the number the user enters, populate that number of combo boxes with pre filled size selections with text boxes next to each combo box to enter the unique identifier?
How would I copy and paste all the parent data with the variation data for each size selected as well as the unique identifier for each variation?
so far I'm thinking I'll need to use arrays for the copy and paste part. I just need some direction. Any help is greatly appreciated!
Thanks Everyone
I understand from your question that you are trying to create a database. If this is correct I would advice you to try and create this in Access. In Access it is a lot easier to link parent data to children. It will also safe you all the time you would need in Excel to code the userforms, etc. as this is (almost) use-ready provided in Access.
If you are determined to create this in Excel, perhaps you could show the vba-code you have so far?

Excel: Create a dropdown menu from a dynamic list without duplicates

The question pretty much says it I guess. For detailed information:
I have a range of cells (F3:F2000) in which there can be names filled in. I want to be able to count the amount of times, a name has been mentioned. I am doing this with =COUNTIF(...), which is not the problem and works perfectly fine. But I want to be able to have a cell with a dropdown menu in which you can choose from all names mentioned in F3:F2000. My approach so far is to create a dynamic list, and then use this for the dropdown menu. But obviously it just uses all the entries and therefore I get a bunch of the same names. So how do I remove the duplicates? I assume this has to be done in the dynamic list.
Here is my formula for the dynamic list:
=OFFSET(Logbook!$F$3:$F$2000,0,0,COUNTA(Logbook!$F$3:$F$2000)+1,1)
And for those stuck with german excel like me :(, the german version:
=BEREICH.VERSCHIEBEN(Logbook!$F$3:$F$2000;0;0;ANZAHL2(Logbook!$F$3:$F$2000)+1;1)
Take a look at this posting, I think it answers your question.
http://www.get-digital-help.com/2009/05/25/create-a-drop-down-list-containing-only-unique-distinct-alphabetically-sorted-text-values-using-excel-array-formula

Updating Inventory

I am working on a spreadsheet that tracks inventory. Basically each week the user goes in, sets his inventory to be used that week, compares it to the current stock and tells him when to order more.
The issue I am having is once the inventory for the week has been chosen how can I get it to update the stock permanently when he exits the spreadsheet?
Specifically then user picks the client name from a drop down menu, that in turn uses a VLOOKUP to show the items the customer needs. From there it COUNTIFs what is needed by all customers and posts it next to the # of each item on hand(refrenced from the "stock" sheet)...I am hunky dory to this step. I can't seem to make the leap to having the amount in stock update upon completion so that when the next user opens the file (multiple copies cannot be opened at once, already set that up) the sotck is current.
Make sense?
OK for a VBA free (sort of) solution you could use a macro. You have in 1 column the current stock, next to it it you have the amount to be deducted from it before exiting the workbook. You will need to add another column that is the amount after deduction. I'm guessing you would know how to set that up if you are using VLOOKUP.
Next step is to record the macro. I'm not sure which version of Excel you are using, but for Excel 2003 you would go to Tools -> Macro -> Record new macro. This will lead to the macro dialog box, chose a name e.g. Update. It would probably be best to chose a shortcut key e.g. u. click OK to start recording the macro.
Highlight the column with the amount after deduction and use edit -> copy. Highlight the column with the current stock and use edit->paste special and chose values and click ok. Finally click on the stop button on the macro recorder.
If you make a mistake, simply click on stop, and go to Tools -> Macro -> Macros select the macro you have recorded and click delete and then yes. Then start again.
In order to run the macro the user would have to either goto Tools -> Macro -> Macros and click run or press Ctrl + shortcut key e.g. Ctrl+u.
A word of warning, macros are not normally undoable so if the user makes a mistake e.g. running it twice they should exit without saving and start again.
Your probably going to need to use VBA.
Cant really give you any examples because I cant see the layout of your workbook and it would depend on how you want to update the list.
You could update the stock count, fairly simple to do but not very safe unless you trust all the users to get it right every time.
If you wanted a little more safety, you could have a sort of "transaction" sheet which stores the change to the stock count for each job entered. Allowing you to fix or remove any erroneous entries. This wouldn't update the main stock list so you would want to periodically merge your transaction sheet.
Update
I've had a quick go at making something using VBA. Again, since I don't know how your book is laid out etc I've just played about. It might be helpful, might not.
Example Workbook
The workbook has 3 sheets: Stock, Adjustment, Log.
Stock
A list of products, the quantity on hand and a re-order threshold
Adjustment
Used to 'adjust' the stock... user enters a product name and the requirement.
The worksheet shows the SOH, the adjusted SOH and advises weather a product needs to be reorderd. (depends on the adjusted SOH and threshold set on the stock sheet)
If the adjustment sheet is populated, when a user saves the workbook they are asked to either update the list (which clears the adjustment sheet), not to update the list (saves the adjustment list for later use without updating stock) or to cancel.
If the adjustments are saved, the information for each adjustment is copied to the log sheet along with a timestamp to allow you to track the changes. If an non-stocked (or mistyped) product is found, it is skipped and the user is told at the end.

Resources