Create Unique List Each Time Worksheet Is Activated
Jan 13, 2008
I am getting a run time error 1004 during a copy-paste of a named range. I've read other posts and the help file and know it's related to defining an object, but I'm not clear on exactly what hasn't been defined.
Private Sub Worksheet_Activate()
Dim lCell As Range
Set lCell = Worksheets("Sheet1").Range("C65536").End(xlUp).Offset(1, 0) ' find first blank cell in the column
With Worksheets("Sheet1").Range("AllDates") 'filter duplicate dates
. AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _
Worksheets("Sheet1").Range("Dates_Filtered").Copy Destination:=Worksheets("Sheet1").Range("lCell") ' fails on this line
I have a list of project numbers that is over 7000 rows long [example attached]. Many numbers are repeated. This list comes out of a financial reporting system. I need to extract a list of unique numbers in numerical order. I have two solutions working, one with SUMPRODUCT formulas and one with MACRO. Here's the MACRO solution. But it takes about 20 seconds to execute. I am just looking to cut down on execution time. I am using this macro a few times on different lists in the same program. Is there a better [faster] way to do this?
I've searched the forum and believe this thread to be the closest to what im looking for, but its doesnt completely apply: matrix to list conversion. I have an attachment to support my questions (see attached). I have a matrix of words (strings) that contain repeating and non-repeating contents. The matrix also has spaces which are of no value. Essentially, the VBA needs to ' analyze' this matrix and create a consolidated frequency list (as shown in the file).
The matrices are HUGE and therefore some of the clumsy VBA i am using is turning out to be a bit inefficient. The file also contains formulas and such that I cannot use AutoFilter nor can I use Insert or Delete rows...so the VBA shouldnt use those either.
I have an Excel file in which a Macro function is triggered by pressing a push-button. I need the Macro function to be executed on a time basis (say 10 sec) instead of upon an external action. Can it be done?
I have a number of text columns, side by side in a worksheet, containing names. I wish to combine these columns into one new column, removing any duplicates, to create a single list of names. Is there a simple way to do this?
I found something similar here VBA - How to select a range in a non-activated worksheet but when I tried to "apply" it, I kept getting an error if the relevant sheet wasn't activated. My code
Code: Dim SearchRange As Range, FindRow As Range Dim column As String, search_string as string column = "K"
What I want to do is to be able to search for a specific value in a specific column on the "Combo boxes" sheet, which isn't activated (the number of rows will never be large, thereof the hard-coded 200).
I get the impression that some sites say the relevant sheet has to be activated, others say it doesn't.
The code above works fine if the sheet is activated, otherwise it fails with error 91 on the msgbox row.
So far I created code that creates a Distinct Unique item's list for one column. It works as it should but I want to modify the code to create a Distinct Unique item's list for two columns that are related to another i.e. a person's name to their license #.
Here is the code below that works for one column only:
I am trying to create a macro that will create a unique list of the values in the same column across 5 worksheets, "Question1", "Question2", etc, and place the list in a new worksheet, "Summary".
The values are in column A in all of the worksheets, and the number of rows in each worksheet will change each day. I need the unique list to be added to the sixth worksheet, "Summary".
Also, after the list is created on the Summary worksheet, I need a count of each field by worksheet and a total. This is how I currently have the Summary set up:
Part Type|Total|Question1|Question2|Question3|Question4|Question5 Name|=SUM(C2:F2)|=COUNTIF(Question1!$A:$A,A2)| =COUNTIF(Question2!$A:$A,A2)|=COUNTIF(Question3!$A:$A,A2)| =COUNTIF(Question4!$A:$A,A2)|=COUNTIF(Question5!$A:$A,A2)
Any way in ms excel to create unlimited unique validation list. i am working on a small data where one colums data(Validation list) changes on the selection of previous column data filed. i am using indirect function with defined name range. but ms-excel is not accepting new names now and still i have 75 datagrops left to define and validate.
is there any formula or vba code to fix this problem.
I have a list of sales events that ran at various venues, together with how many people attended and how much revenue was brought in by sales. This data is arranged by week. One venue will never have more than one event per week, but different venues may have sales events on the same week.
My table looks like:
In reality this list could be thousands of rows long.
“Event week” is the calendar week of the event. “Weeks open” shows for each event how many weeks that venue has been open (may or may not be useful!).
What I need to do is to be able to pick a number of weeks (preferably changeable by entering into a cell) and have a list produced of each venue that has run for at least that many weeks, and the sum of people and sales in those first X weeks. My idea of output, if the user input “2” as the number of weeks would therefore look something like:
Note that 1)only venues that have run at least 2 meetings are shown in the output 2)even if venue has run over 2 meetings, only people and sales figures from the first 2 are summed up and displayed.
In this case. Later on I need to produce a frequency chart/histogram grouping the results into categories, but I know how to do this as long as I can get to the step before – but wanted to mention it in case there are shortcuts.
Have been battling with this with pivots, database functions, array formulae etc. for a long time.
Attached is the spreadsheet with sample data. The red table is the part I am stuck on. The solution has to work in Excel 2003.
In D2:D11, I want a non-duplicate list of all the "1" names, i.e., Bob and Josh. In E2:E11, a list of all the "2" names (Sally, Bill & Jacob), and so on. Sorted would be nice, but not necessary. When new names and their numbers are added to A1:B200, they need to automatically show up in D2:G:201 as appropriate. I've looked over VLOOKUP, INDEX, MATCH, etc., but all seem to simply return the first and not every match. Maybe I'm just missing it.
Is this possible without VBA? Not that I have any objection to it, but delving into and learning it is a little outside the available time I have now. If it takes VBA I'll address it when I can free up some time.
In Excel I recorded a macro by carrying out some operations and then copied the code into VBA code window to the click event of a button expecting the code would operate well but in vain. What is wrong with my operations? By cliking command button placed on a userform I want to copy the date of one column to another and the data thus copied into another column should contain only unique value.
I need to be able to pull information from 5 columns on 5 different pages, and pull all of the unique names out of it. From there, I need to create a list of all of these names. More often than not, this could only be three names, but I still would like this to be automatic because eventually it could be 50 or 60, and manually editing this list would get tedious. Lastly, is it possible to have a list create cells? For example: I have information on row 4, this one will start on row 6. My next group of information starts on row 14. That leaves 7 rows for information. I don't want to leave a large gap at the top of the page, so I'd like to be able to create cells if the list I'm trying to create has more information on it. Seems plausible in my mind, but I'm still new to excel.
In that file, you can see there is a list of somewhat similar data across 5 columns. Some of the entries are duplicates, some are different by only one character. What I want to be able to do is generate a list of all the unique rows of data, taking into account the data from ALL 5 columns. The list can be on another sheet or simply just further down on the same sheet, that doesn't matter too much.
I could do it if it were just one column of data, but struggling trying to do it with several columns.
I need a Macro to create a unique, rolling data list. On Sheet 1, a report is pasted(from outside source) in cell A3(Rows 1 & 2 are headers) on a weekly basis. It is always the same amount of columns wide(138). The number of rows will always vary but will never be more than 500.
Hereâ€™s what I need for Sheet 2:
-Column A should be a copy from Column A on Sheet 1 (data is ITEMS) -Column B should be a copy from Column BH on Sheet 1 (data is QUANTITY of items) -Column C should be a copy from Column BI on Sheet 1 (data is PRICE of items)
Hereâ€™s the challenge (when the new report is pasted on Sheet 1):
-Sheet 1. Find new ITEMS not on Sheet 2 and paste them at the end of the report on Sheet 2 along with their QUANTITY and PRICE -Sheet 1. Find any ITEMS already on Sheet 2, then update new QUANTITY and PRICE from Sheet 1 onto Sheet 2 -Sheet 2. Leave ITEMS alone that are now missing from the new report on Sheet 1
method. It seems like the limitation is in the Countif function going over 1000 (or some other size limit)
I have a list of ~1500 rows, of that there are approximately 55 unique items. Doing the unique array works correctly up until item ~40, upon which it fails by returning the 1st item only (for the rest).
Trying to debug, and pulling out the Match section, it functions up until 976 (that is
returns 976) anything after returns just 1 (1st item).
It seems to be a limitation on the text string size that COUNTIF can handle.
I'm trying to Filter a list by the criteria selected in a listbox, and activated by a command button. My problem is the sort criteria. I have 11 regions, numbered 01EPS through 11EPS. Sorting by any of these criteria works just fine.
The problem is that I also want to be able to sort by ALL of the regions at once. I can do this by using a custom filter. I recorded a macro to see what the difference was, and it simply a matter of changing 01EPS to "=*EPS". However, adding that to my case list results in an error message of "Compile Error: Syntax Error".
I'm trying to do is a unique list or summary of a worksheet. First there are 4 columns that need to be read, then from this list a new list must be created using advanced filter with unique value. Then the first 4 columns must be deleted and replaced with the new 4 columns, in the third summary the totals for Gender 1-3 are aded together depending by the quality and the same for gender 4-5. I'm attaching a sample file to show how the summary is supposed to look when is finished. I need to do this in code because the rows may vary depending on the brands, genders and qualities. I deleted some info to reduce the file size