I have a 3500+ row table that each week 250 old lines are removed and 250 new lines are added, say on a Sunday. Throughout the course of the week, columns Y and Z are used to write comments (Y via a drop down box). These comments are to stay with the associated row.
My problem is updating the table with the new 250 lines. The new lines will be released as a new table (so mixed amongst the 3000 rows that are not removed). Previously I copied all the data into another worksheet, performed a vlookup and then copy and pasted over the old table. Is there a better or quicker way? Open to using VBA/Macros.
Thanks in advance
Use the Remove Duplicates feature in Excel on the Data tab.
This feature, allowing one to choose which column to use as the comparison factor is easiest.
If you need to write a macro, there are faster ways to code it than looping through 3000+ values to look for a duplicate or using FIND to locate duplicates.
I had a similar problem and wrote a macro to eliminate duplicates using a loop for 2000+ rows of data. It took 2 minutes to execute. The method referenced below took 2 seconds to execute!
Check out Rick Rothstein's code at
Fast Duplicate Check For Large Data Sets Using VBA
I used and modified his code and it is the fastest solution I have found.
Related
Currently the stock process at my company is very manual and it normally doesn't get carried out due to the process being rather boring. Currently all excel based I am slowly moving over to SQL that will automatically update the information.
We have come up with a naming system/code for each item, this is made up from several fields on the excel document. However there is the same codes in different columns that we wish to remove for when we push into SQL (Basically we just want the 1 line item and a count of how many times it has been used)
It has to be dynamic. (I can add an extra tab to the excel document to do any magic required) and if possible not use any Macros
So the data starts like this:
#Counts and then the duplicates are removed to produce this list
I have tried a range of countifs/Vlookups and I can get it roughly working but its not dynamic enough and I end up having multiple rows of 0 Qtys
Hopefully this is enough information
Cheers all
It looks like a very similar question was answered here.
After plugging in that formula in a different column, you can use the CountIf function in the next column.
I have been searching high and low for a way to solve my dilemma, in different ways, so I am trying to post both of the things I've been trying to do:
The challenge version 1:
I want to extract the entire row with information tied to the name which is the latest entry of that name in the table. So from the table below I would want to collect the entire row which contains the information: "A, Jack Black, 01.01.2029, 10:20". I simply want to copy the entire row to another sheet. But one important factor is that it has to happen automatically.
So i need functions which can check if: Is there another entry with the same name, higher up in the table? If so, DO NOT COPY THE ROW. If there ain't another entry with the exact same name higher up in the table, COPY THE ENTIRE ROW, to another table, within another sheet.
The challenge version 2:
What I really want to do is count the number of unique people(unique names) per. department, and summarize this in another table. Basically this means that "Jack Black" should be counted as 1 person, in department A.
So the result I want, is a table looking like this (the one beneath), where the number of people does not contain any duplicate people (names). OR it does not function with a dynamic table, which updates the information it contains on the fly. I can make this happen if I am copying from a static table, but as stated above, the table is dynamic and updates with new information every minute...
So far i've tried excel's built in filtering, but this does not work automatically. I've also tried using functions like in this guide: https://excel-bytes.com/how-to-extract-a-dynamic-list-from-a-data-range-based-on-a-criteria-without-filters-in-excel/. However every solution i find seems to need criteria for filtering out duplicates or does not function when copying information from a dynamic table.
Does anyone know how to reach my desired result, without implementing criteria for selecting the rows or counting rows as stated above? VBA code is not an option at the moment :(
In advance, THANK YOU, I've really tried solving this, but I feel like this just might break my head wide open soon if I can't solve it. HEEEEELP!
Sincerely
haakonlu
nothing stuck or broken, just I am inspired after a discussion with another Excel author.
His situation:
Read from an existing Excel monster file (column FG), and hard-coded the following
Range("FF:FG").Copy
Potential issue:
data in FF:FG will be pushed to GF:GG every couple of months because newer columns will be inserted in between. (It's a pivot-like design... sorry, but end-users need this appearance, but categories are increasing, summary need to be at right end side)
He has 2 other choices (if he don't want to maintain VBA code every few months):
A: Store "FF","FG" in a Cell (fixed location!), then read the location parameter using VBA
B: Read a second dedicated CSV file (copy/paste from the monster file, consumed by another user so available readily), it only has the 2 columns required..
To me, none is obviously better than the other, just a matter of preference.
Similar but simpler Scene of mine
I produce the monstrous file by lots of Vlookup from manual data sources (inherited the design... and I refactored the design using another automation tool but there is license consideration atm).
In a column there is a formula doing something like
=if(A1="SALES PERSON SICK","void result",(if(A1="MACHINE BROKEN",C2*0.8),"")..
say 5000 rows with this formula
To reduce hard-coding I moved
"SALES PERSON SICK","MACHINE BROKEN" to a reference sheet cell A1,A2, and changed formula to:
=if(A1=Ref!$A$1,"void result",(if(A1=Ref!$A$2,C2*0.8),"")
I feel it's a good practice.
Question: Is method A or B better? Considering column position will move every ~3-6 months, still worth choosing 1 from A/B?
data in FF:FG will be pushed to GF:GG every couple of months because newer columns will be inserted in between
Then you should use named ranges in what you call "monster file" (see Define and use names in formulas) and use them in your VBA.
Eg define a name for Columns FF:FG like CopySource (use a name that describes the data in that columns) and finally you can use that in your VBA code.
Range("CopySource").Copy
Whenever the range moves because new columns are inseted before, the named range moves too, so it still points to the same data.
I'm trying for the life of me to figure out Excel VBA but I've been getting nowhere.
Here's what I'm needing to do:
Have a list of thousands of entries - each one corresponding to a ticket for a customer. Columns include information like client name (Column B), # of minutes worked on per ticket (Column I), etc.
We're trying to make a macro that totals the # minutes of worked on for all tickets of a specific client in a new row directly below, then hide all of those rows.
The end result should be only seeing a row containing "Total -client name here-" in the name column, then the total number of minutes in the # of minutes column.
The previous macros I've done aren't dynamic and were done via recordings within excel (which obviously don't work the way I wanted to, apparently).
Programming isn't my forte, and all this has been doing is making me want to pull my hair out. Any help?
It sounds like you'd be better off using a database like Access. You can enter all your information into a table and then write a query to find what you need. If you don't want to use Access, we'll need a better idea of what you're trying to do.
I have a column with 595 rows. Then I proceeded to add 20.
(Note this excel sheet with the 595 entries was already in place before I started working on it. The sort feature was working correctly, as was the filter feature).
So now, I can still USE the sort and filter methods, but it does not take into account these 20 new rows. Any ideas?
Also, I cannot remove the borders on these 20 new rows. They are pretty thick and say I just did 'no borders', it doesn't modify anything.
It seems like there's a 'cutoff' at 595 or something. Very weird.
Another solution which may not be as obvious is to Un-click the filter button under the data tab and then re-click filter.
I had the same problem. After 45 minutes of experimenting and 'googling' for solutions it turned out that the new names I had entered did not have a space in front of them like ALL the other names in that column did. So check to see if the data in the columns are the same distance from the cell wall. If they are different, try adding or removing a space and re-sort. Good Luck
I had the same problem using an absence tracker downloaded Excel worksheet from Microsoft, where I added 30 rows. I fixed the problem by clicking/activating the table and viewing the design tab. Click Resize Table and edit the table range. This color coded the rows and allowed the filter to include the added rows.
I had this same problem, expanding the 'fill handle' as John Bustos (Nov 12 '12 at 17:29) suggested was all that I needed. I didn't have to turn filters off and on afterward either.
When you set up the Filter, it accounts for the range of data you initially have. When you add rows, they are outside of that range. So if you have one additional column that has something in it, like the word "blank" or just "X" or something, and make it go down to row 1000 or 2000 or something, then when you add information in new rows, it should keep the full filtered range, and the sorting would also include the full range, all the way to the row 1000 or 2000 or whatever you make.
As #JohnBustos suggested, the 'zebra' type row color is an outcome of choosing a certain condition in a pivot table.
When you add new rows to a table extracted from Pivot table, in order to include filter conditions/ sort for newly added rows, you need to -
Go to far bottom right in row 595,
you should have some kind of a fill handle,
drag it down to now include your new rows too.
Make sure there isn't a space before the new data. That will sort in two batches.
There's a little handle at the bottom right corner of your table (as it exists)...drag this to the bottom of where your new data exists, and it should auto-expand the table to include the table design + filtering. Took me forever to figure out