Prevent Duplicates In Formula Generating Same Names
Nov 7, 2006
The following attacted program is a name generator. It randomly generates names from the Roster sheet to the shuffle sheet (to be randomized) then displays it on the watchbill sheet. The problem I'm having is that the names seem to be repeating themselves before the entire list is used at least once from the roster sheet. I need all the names to generate at least once then have it fairly repeat the names (but not in the same columns on the watchbill sheet). Can this be done using the formulas I have? I've been trying to figure this out forever, its just a little beyond my level.
I have a workbook where Sheet 1 Col A is a list of dates. Sheet 2 Col A is a relatively short list of constantly changing names. I need to put this list of names in a repeating fashion in Sheet 1 Col B. Ideally I would like for Sheet 1 to regenerate Col B each time the roster list is changed.
I have been given a list of my firm’s target clients (in excel) and an opportunities report (exported into excel) from our CRM system, which lists all the opportunities (i.e. opportunities to sell/provide products/services) that have been created for each client. Some of the column headings in the opportunities report are as follows:
Client; Opportunity ID; Opportunity Name; Opportunity Description; Created by; Date Created etc.
What I need to do is lookup each client, from the target clients listing, in the opportunities report to see whether an opportunity has been created; and if so, return the row of values (i.e. the Opportunity ID; Opportunity Name; Opportunity Description; Created by; Date Created) for that client. The result will be placed next to the name of the client in the target client worksheet.
I have a couple of problems. Initially I tried to use the VLOOKUP function to lookup the client name in the opportunities report and return the Opportunity ID (I then planned to use the same formula to return values from the other columns); however, as the client names in the target client listing were not always written the same way as they were in the opportunities report, the formula often returned #N/A. The formula I used was
So for example, the first client that I was looking up was written as “ABC Ltd” but in the opportunities report it was written as “ABC Limited”.
My second problem was that for some clients, there were multiple opportunities listed in the opportunities report. Where this was the case, there was a separate row (repeating the client name in the first column) for each opportunity created. I think that was messing up my VLOOKUP formula as well.
Is there a way to look up the client name, from the target client listing, in the opportunities report even if it’s slightly different and return the row of values for each opportunity created for that client on a separate row?
How do I keep the same names from coming up on the same column when randomly generated there (I hit f9 and names randomly generate on my sheet)? I'm trying to integrate this fix into =IF(Override!G5>0, Override!G5, Shuffle!A34) formula. That formula is the formula that recieves the randomly generated names into the cells I have chosen. The override is so I can do just that if I dont like the generation of names.
name 1 name 2 name 3 name 1 <---if that happens I want this cell to respond by reshuffling until it equals a name that is not in its column, but just that one cell, not the others.
I am trying to prevent/remove duplicates and blank rows from occuring in a spreadsheet which is being populated via a Userform. The user must be able to add items to the spreadsheet during the normal course of work, so I guess that the blank line removal should occur when they exit the module or application.
However, duplicate prevention is particularly important as the data being captured pertains to products. Column A of the spreadsheet contains the product code and that will be the "watch" column. I have tried various options, particularly for removing blank rows and have so far have not had success.
Something that I have noticed is that when a new item is 'added' to the spreadsheet and the job is either cancelled or not saved, that a simple resize of the range through a recount of the rows to the first one empty does not remove the blank lines which is interesting too.
I'm an intern working at an aerospace manufacturing house and I need to automate a lot of the excel files I created last summer.
Anyway, here is my problem:
I've been making macros but I am worried about people moving the worksheets around or changing their names which will have the potential to mess up the macros. What preventive measures can be taken/ changes in the code? I feel like there is something very simple I am missing.
I am trying to get a list of all names found in a column but exclude duplicates... I know this can be done in a pivot table but I need the names in a drop down box... if I use the pivot table as the source it will pick up "Grand Total" as a name.
The number of people can increase from week to week...
So basically I have a spreadsheet that tracks if a patient has turned in there required paperwork within the last 6 months and then changes the cell to white and lets me know how many days they have left until they are due to turn this paperwork in again. Then if it has expired I have a condition format change the cell to Red but I would like to add in the text EXPIRED to the cell. lastly I have Cells that have no data in them gray and I would like to add in red text saying No Paperwork.
I'm hoping this will be my last build of this spreadsheet so I can go ahead and start applying it to the real workbook [URL]
What formula can I use to accomplish the following, if it can be done.
If B9 is 100% all the rest of the % cell inputs would be 0%
If B9 is less 100% ,lets say 50% all the rest of the % cell inputs would be less than or equal to 50% until any sum of those cells equal to 100% in which case if I enter 50% on B9 and 25% on D9 and 25% on F9 their total sum would be 100%.
If I try to enter a % on H9 it should not allow me to do it because then the total sum on O9 would be more the the original amount on A9
The attached file contains hypothetical data on a basketball player's success from the free throw line. It lists the number of free throws attempted and the number made and then divides the number made by the number attempted to calculate the free throw percentage. However, I keep getting a # DIV/0! error in the games free throws weren't taken. How do I write the code so that when the error occurs, a message is displayed to the effect that no percentage can be reported because no free throws were attempted by checking the cell in column D? How do I use the IsError function to figure this out?
I'm creating a maths workbook in Excel. I want the user to workout the answer in his/her head and enter the answer into Excel. The only problem is, of course, that there is nothing stopping a user from simply typing a formula to obtain the answer! I have tried all data validation, apart from Custom which I can't figure out. Is there a way to prevent a user entering a formula on a worksheet?
I've got an issue where Formulas Referencing Cells on another sheet are getting changed automatically to refer the the moved cell data. The formulas on a sheet (2) refer to specific cells on sheet (1) within my workbook. I update Sheet(1) data with a macro. When sheet (1) updates, the present data gets shifted to the right.
In other words, I need to prevent the formulas from changing to reference the moved data values and keep referencing the initial cell with the new values. xample of change that occurs with update:
Dim rng As Range Dim i As Integer, counter As Integer
Set rng = Range("1:1")
i = 1
For counter = 1 To rng.Columns.Count
'If cell i in the range contains an "x", 'delete the column If rng.Cells(i) = "x" Then rng.Cells(i).EntireColumn.Delete Else i = i + 1 End If
My problem is that I have cells in other worksheets linked to the worksheet that is running this macro and everytime I run it, I get a handful of "#REF" errors. I think this problem might be solved if I could simply delete the contents of the column rather than deleting the entire column. How can I modify my code to do this?
I Spoke too soon here, I am getting value errors, how to do it with conditional formating. I tried if cell value is =to #DIV/0! then white (dosent work). Richard this dosent seem to work mate =IF(SUM(F6:V6),"",AL6/SUM(F6:V6))
I have an IF formula on one worksheet that refers to another worksheet (ex: =IF(Page1!$A13="";"";Page1!$A13). The problem is when I move data from one cell to another the formula becomes #REF. (ex: =IF(Page1!#REF="";"";Page1!#REF)).
I have a series of worksheets, named, 'sheet1' 'sheet2' etc. through to 'sheet10'. A final worksheet, 'sheet11' has been produced that uses the formula: address=Sheet1!A1, address=Sheet2!A1, address =Sheet3!A1 etc. The same goes for other identical cells on each of the sheets. I am at the moment entering each cell on 'sheet 11' separately because if I copy the formula down it progressively changes the cell value and not the sheet number. How can I produce a formula whereby the cells remain identical but the sheets change progressively?
I've got a workbook that I'm currently designing and I've just realised that I need to delete a few sheets, paste in some new template sheets and rename them. The problem is, I've already completed my summary sheets and I don't want to have to redo the values. Essentially, I just want to (temporarily) turn off auto-updating of formulas when cells / sheets are changed/moved/deleted.
For practical purposes: I need to delete the sheet named "Jan", paste in a new sheet "MonthTemp", rename "MonthTemp" to "Jan" and have all my formulas not updated (e.g. still referencing "Jan" instead of "#REF!")
What I have is basically a form on the main sheet. Here other users can add and/or delete information in a form. I refer to the information in another sheet with formulas.
Now everything was great when using protections/ validations, to the where they fill in the information, but the problem occur when they are allowed to delete and remove rows.
This is something that I want to allow them, even though I do realise that this is something that many advice against it.
To begin with I found the post about changing relative references to absolute references (ConvertFormula). Still the formulas changes when rows are added or deleted and I would have to redo all formulas and run the macro again. I then found posts advicing on the use of the INDIRECT forumla. This formula was exactly what I needed as the formulas would not alter when rows were added/deleted. Now the problem is a combination of the use of INDIRECT and the the ConvertFormula. Now if I write a formula, for example:
Then when I try to expand the formula over to the rest of the cells, then the references stay pointing at A1, when I want them to continue pointing at A2, A3, etc...
Now what I am looking for is some way to tell all my formulas, after expanding the original formula, that they should all have the INDIRECT function. If it was possible it would be great if you could implement it in the same way as with the absolute reference, for example:
For i = 1 To MyRange.Areas.Count MyRange.Areas(i) = Application.ConvertFormula(MyRange.Areas(i).Formula, xlA1, xlA1, xlIndirect) Next i
Now the above code sample does not work of course, as there should be xlAbsolute instead of xlIndirect, but I hope you understand my intention. Do anyone have the answer to my problem? Is there an easy way to implement the INDIRECT function into a big amount of formulas?