VBA Functions - Multiple Inputs And Keeping Track Of Them
Sep 17, 2013
I have several formulas that I use over and over, so I'm creating VBA functions that I can call from a worksheet.
But...when I have multiple inputs going into a function, is there a way to remind the user which input comes next in the same way that Excel does with built-in functions?
For example, when you type in =PMT( Excel brings up the helper text so you know that the order of inputs is (rate, nper, pv, etc....
Is there a way to bring up that same helper text in my own function? So if I have up, down, right, left as inputs and give the spreadsheet to someone else, they can see it's up, down, right left and not right, left, up, down .
i am a builder and i want to make a spread sheet to keep track of what i have been paid and the labour costs i have paid out
so i am working on 20 houses that all have 7 stages of payment each, and 5 to 8 men working on them who receive a price for each stage, but are paid a portion of that price each week while they are working on that stage
what i am trying to do is set up a sheet to keep track of what has been paid and the balance remaining for each stage and what has been received
i have tried doing it a few different ways but im none to clever with spread sheets and what is causing me the problem is next to each payment made i need to put the date and the name of the person who was paid so it always seems to just look a cluttered mess
have any of you got any ideas of how i could simplify this and make it look neat and easy
or alternatively is there some other software that may suit this application better?
Say, for example, I have a spreadsheet as follows:
0 1 1 2 3 2 0 1 2 1 2 1 2 3 3 1 0 1
Is there a way to count the number of times a specific number shows up and have excel post it to a different cell? I need to know how many times a certain number came up for a specific row, and how many times.
I'm fairly new to using excel and have been trying to create a simple spreadsheet that keeps track of scores and automatically displays the names of the players in descending order. Anyway I have gotten to the point of using hookup to match a value and return that players name. But when two players have the same score it will only return the first found value. I sort the number scores using a LARGE function and it works great. Then I use something like this =HLOOKUP(Y2,B27:K28,2,FALSE) to match that value with the players name. How to return the other players name when the scores are the same?
I work in a medical facility, and I need to track data I've entered representing patient visits indefinitely over time. I've attached a weekly grid to this thread that I use to record which patients have had visits during the course of the week. It sums their total visits on the right. I need to continually track these because every patient gets an insurance-mandated progress update after 10 visits. Unfortunately, they don't always show up, and the most I can possibly keep track of is two weeks, max, and most patients only get two visits per week. Is there a way to dump these sums into another column indefinitely?
After all the awesome macros I've obtained with the help of all of you, I now have over 30 macros, each in its own module. I have tried without success to re-name the modules with no luck. How is everyone organizing these?
I maintain the data flow at my work. We send and receive the data using excel files with specific formatting that I then upload to the database. Each time I send or receive the excel file I must log them, this is what my code question refers to.
I use RDBMerge to merge all the contents of the 100 plus excel files into one worksheet. The first part of the macro cleans up the merge data for use in the log (i have attached an example of the clean data and finished log).
The blue shaded area of the "Raw_Data" is what the clean data looks like, the yellow column is what current macro records for each record.
As you can see by the example the Raw_Data is only two files LL_LLL_BOB_ToLLLLL_20121228_01 & LL_LLL_BOB_ToLLLLL_20121230_01, each with more that one record.
The log code in column "H" Is based on this criteria: First Letter of the Unique ID in column "E" - O, M, or L Program Type in Column "F" - U or R 1. O-U = U 2. O-R = RU 3. M-U = U2 4. M-R = R2U 5. L-R = R
You will note that Columns G-R of the "Log Sheet" correspond to the "Record Type" found in Column "G" of the "Raw_Data" sheet.
This is the area where my skill at using scripting dictionaries fails.
The results for the log list each file only once, but the log code for each corresponding "Record Type" in columns G-R of the "Log Sheet" must contain each unique instance of the code. In other words
if LL_LLL_BOB_ToLLLLL_20121228_01 contains an O-U with an "A" Record Type and an M-R with an "A" Record Type; then, on the log sheet there needs to be the codes "U/R2U" in the cell intersection of the LL_LLL_BOB_ToLLLLL_20121228_01 record row and "A" column (which is column "G")
So, If the File contains one of each code for each Record Type the corresponding cell must house one of each code separated by a "/" without any spaces. This means the cell value could no code, or one code and all the variations in between to all five codes. Also, for ease of human reading the log codes should be concatenated in the 1-5 order that I listed them in (U/RU/U2/R2U/R)
Here is my code so far.
VB: Option Explicit Sub test() Dim dic As Object, a, i As Long, rng As Range, e, w, n As Long Set dic = CreateObject("Scripting.Dictionary")
I am trying to set up a "diet log" for my nephew to track his eating habits for a school project. I am trying to make the "total" section of the attached spread sheet auto calculating depending on the information placed in the "breakfast / lunch / dinner / snack" catagories. I have two worksheets in the file. The first being the preferred method of a single cell and seperating the items using only a ",". The second sheet has a little bit different lay out which I don't think will work as nicely.
Honestly, I am not sure if this will even be possible, but I figured I would try here as a final resort. Currently there are just some sample foods in there as I will let him fill in the actual workbook for his use.
I have a spreadsheet with a medium-sized data set, and I need to look up values from the large table, and thin the table down to only the relevant values.
To arrive at each unique value, I will have to match 3 input cells to the first 3 cells of the data table, then copy values from across that specific line to the appropriate cells of my smaller table. I really don't need to sum or do any math in this step, its just a copy from the master table to the smaller table, the math will come later.
I think I'm attaching the file (remember-first post) so hopefully it will help with what I'm trying to accomplish. Hopefully this isn't a big deal, but I've been pulling my hair out on this all day and I just can't find a solution anywhere that really matches up to this.
I have a spreadsheet with over 70 worksheets. The majority of these are concerned with Work standards (National Occupational Standards), each of these standards are further broken down into performance criteria.
What I would like to happen is for a person to be able to enter a "Yes" or "No" response in a box to a specific question on an assessment report or a witness testimony worksheet. If a Yes is entered I would like the spreadsheet to automatically enter a reference i.e AR1 or WT2 (stated by the inputter on that worksheet) in each of the other seperate worksheets that cover this perfromance criteria with this reference.
Because many of the worksheets contain similar performance criteria, i.e "treating people fairly and with respect". The answer of "Yes" on the assessment report worksheet may require a reference inputting on anything up to 60 different worksheets. Is this possible or am I dreaming of the impossible?
I really should have asked this question before I wrote out all the seperate worksheets.
I am trying to create a vba using only one macro button (excel). I would like for them to enter their names and have their own password that will then insert their signature(pic.jpg) in a specific cell.
I created a certificate in excel and I don't want 12 (number of people) buttons visible. Id rather have a long code. Im not sure if using If and Then and ElseIf is the way to go.
I am looking to create an excel search with two input and three output values on Sheet 1 that will link to a table on Sheet 2. To help illustrate:
The two white cells indicate the two input values, and the three blue cells indicate the three desired output values.
I want to enter the two input values (Length and Width), press the "Search" button, and have the corresponding output values (DWG#, Item #, and Tooling #) from Sheet 2 appear in the three output cells on Sheet 1.
I am looking to take the data off of a "detail" sheet and put it to a summary page. I want the summary page to find the capital and expense from "details" sheet by the month on the "details" sheet. Then for every month add all the expenses and capital and put as 2 values per month, Capital and expense, on the summary page. I am not really sure where to begin but have added my excel workbook that I have started.
I'm working on a fairly complex spreadsheet where I want to pull conditional formatting into an entire row. I have a column in tab1 where I have a bunch of beer styles listed. On tab2, I have a 2 columns: a complete list of styles with a 'yes' or 'no' in the next column based on certain criteria. What I'd like to do is have the column in tab1 highlight if that style in tab2 has a 'no' in the column next to it.
1. I need a template that allows a user to select a location from a dropdown menu (Cell B1 of Example Data tab). 2. Titles in cells C1:V1 and B2:B8 will stay the same. 3. Data inputs within range C2:V8 would change for each location. The idea is based off the location selection from the dropdown menu, different data is shown within the range and available for updates. 4. The chart (see Example Chart) would sum all location inputs in range C2:V8
I want to create a macro to take multiple inputs from sheet 2, apply them simultaneously to the inputs on sheet 1, take sheet 1's output and list next to the inputs on sheet 2. I want to apply this to a spreadsheet with complicated calculations. Example spreadsheet attached. Related Macros I have will do a similar thing but only take one input at a time. Code as follows.
VB: Sub x() Dim r As Range With Sheet2 For Each r In .Range("A2", .Range("A2").End(xlDown)) Sheet1.Range("A2") = r r.Offset(, 2).Resize(, 3).Value = Sheet1.Range("C2:E2").Value Next r End With End Sub
I have a spreadsheet of courses required to reach a certification. On this spreadsheet I have listed the number of hours required for each course in one column, and how many hours I have accrued in an adjoining column. Not all the hours will occur at once, so I tend to bound from cell to cell adding hours in small amounts. What I am trying to do is create a macro that will allow me to add to the existing number of hours to the newly accrued hours, without typing over what is already there.
For example…Class 1 requires five hours total, and I have two hours accrued. If I accrue two more hours (for a total of four hours) I want to update cell E2 without going in to this cell manually and changing this number. I would like to enter the additional two hours in a text box or similar function, and have that function update E2. To add to the level of difficulty, there are four levels of class. This means not only do I need to be able to select which class hours need updated, but which level of class. I have attached the spreadsheet I am working with to try to make things a little clearer.
I have an excel file with over 20 worksheets and each of them have around 1200 rows. The first column in each worksheet contains the variable names and then the data associated to it is present horizontally.
I only want to keep around 80 rows from those 1200 rows. They are not in sequence (means they are not in continuous order) so I manually selected those rows by deleting the non required rows step by step.
I did it manually on 2 worksheets but I don't want to do that manually over 20 worksheets. Is there any method that can speedup the whole process.
For the odds range, i have already two cells(the upper(F9) and the lower(E9)) and i have a cell named the current odd(G9). What are the formula together for the attribut cell(H9) for the following data:
1.0 : The current price is outside and below the odds range spread. For example, if the range is between 2,00 and 2,20, the range’s attribute will be 1.0 if the current price is below 2,00 NOTE: Obviously the formula for this one is =IF(G9
1.1 : The current price is on the bottom edge of the “odds range” figure. For example, if the range is between 2,00 and 2,20, the range’s attribute will be 1.1 if the current price is 2,00 NOTE: The formula for this one would be =IF(G9=E9,1.1)
1.2 : The current price is inside the “odds range” spread and is placed one or two clicks from the bottom edge. For example if the range is between 2,00 and 2,20, the range’s attribute will be 1.2 if the current price is 2,02 or 2,04 NOTE: I have a hard time creating a formula with this one.
2.0 : The current price is outside and above the “odds range” spread. For example, if the range is between 2,00 and 2,20, the range’s attribute will be 2.0 if the current price is above 2,20 NOTE: The formula would be =IF(G9>F9,2.0)
I've tried many variations but I can't seem to find a solution - I hope you can help. I'd like a formula that will ideally achieve the following:
IF B5:F5 all contain the letter y then return "Pass" IF B5:F5 AND G5:K5 all contain the letter y then return "Merit" IF B5:F5 AND G5:K5 AND L5:K5 all contain the letter y then return "Distinction" IF B5:F5 is blank return blank IF there are Y's in B5:F5 and the total < 5 return "Fail"
I did a sample sheet to show the desired output but don't know if this forum supports attachments.
I have two spreadsheets (the samples for which I have shown side by side in Sheet 1 of the attached file).
Spreadsheet 1 is about 30,000 rows and too large for me to change the formatting and structure.
Spreadsheet 2 is the output I need and the format is required by other stakeholders.
In spreadsheet 1 I want to sum quantity in stock for Type 1, Type 2 and Type 3 for each product and allocate it to spreadsheet 2 according to the month in which the product expires. For example, there will be a total of 92 units of product 413302 which will expire in Nov, 2014. Therefore I want 92 to be placed in cell N6 of Spreadsheet 2.
Unfortunately the product number is not unique - there are multiple sub products in spreadsheet 1 but they all have the same quantities of stock. The sub products are referenced in other parts of the report so I can't consolidate by Product Number. This also prevents me from using the SUMIFS function as it will duplicate the number found in the sub products.
What I need, perhaps in a combination of functions, is to find the first instance of product 413302 in Spreadsheet 1 that is expiring in Nov 14, sum the product types and give the result in cell N6 of Spreadsheet 2.
Is there a way to SET a RANGE that can be used for further editing without the need to specify the range each time for each function to be perfomed? I have a pile of Data, with a Calendar date and 4 columns of data for each date.
I want to make a summary for each year separately of one column of data (Total PL). How can I set a condtion that it will output a summary of data for a given year, e.g. 1990?
Even more useful might be setting up a table for each year, where I will be able to perform easy function like SUM, MAX, MIN but it will use data only from the specific Year in each row. - Is there a way to make it simpler, but not having to specify the RANGE for each Year for each Function?
* I have a complex Excel workbook with several worksheets.
* The first worksheet is for raw data, which consists of a single string of data, separated by spaces, to be uploaded to a mainframe. There is no consistent pattern of length of data or strings in between pieces of data, which can vary widely. An example of the data would be something like this:
XXXXX YYYYY NN XXXXXXX
* For testing purposes, I need to come up with a way to parse the data for easier viewing. The current approach is this:
* Take the string and divide it up into individual cells by using the MID function. In the above approach, this would split the data into four (4) different cells.
This is going to be a very complex workbook with data strings that can have 20+ elements in them, and have lots of separate records, etc. While this way should work (if everything is entered perfectly and no data structures ever change, etc.),