I have two sheets, one is a huge table of item ID's with a corresponding code column next to them. However over time this has not been properly filled in. I have assembled a complete list of item ID's and corresponding codes in another sheet.
I want Excel to fill in the blanks using the ID column as a key.
What's the easiest way to get Excel to look for the ID in the main sheet, and paste in the corresponding code from the other sheet?
Rather than fill in just the blanks - and face the issue of how then to skip over cells already populated - use the same formula to fill in the blanks and to overwrite whatever happens to be present already.
Related
Is there a way in excel to copy the contents of one column to another sheet based on particular values in another column.
I have data which looks like this:
Sheet1:
Sheet2:
I would like to copy the column A of sheet 1 directly onto column A of sheet 2, but only if the value in column B is Y.
I have tried used the match function but am not sure how the best way to do this would be. Is there a way for me to achieve this?
My desired output is:
As discussed in the comments, #Waldorf99 was looking to have a second worksheet that would automatically show a filtered list from the first sheet. I can think of a few ways to do this (array formulas or pivot tables come to mind). The problem with mixing dynamic columns with static values is that the static values would become desynced from the dynamic ones.
In the original example, rows may have a blank value in the condition column in sheet one, and then may be assigned a Y or N at a later date. If a Y is assigned to a row in the middle of other rows, the filtered sheet would shift the existing rows down to make room. The static values would stay where they were, and would become desynced. To demonstrate:
If the above image is the original state of sheet 1 and 2...
...adding a y next to x.1.c would result in sheet two shifting columns A and B of row 2 down, but leaves columns C and D behind (as they are static, and not tied into the first two columns in any way).
One thing that may work as you are wanting are filters. You would only have one sheet, with all of the data manually entered. Then you can add filters, and change them to hide rows temporarily when needed.
To add and use filters:
Start with your data all on one sheet...
Highlight your data...
On the Home tab, select "Format as Table" and choose any style...
This turns your data into a table. You can filter by clicking the drop down in a given columns header row, then deselecting the values you want to hide.
The results are a table that only shows the rows with a 'Y'.
The other rows aren't removed, just hidden. You can always reset or change your filters, to configure which rows are visible.
Note: when working with tables, they will auto expand to account for new rows, so long as you work in the row directly under the table (e.g. don't leave blank rows). You can also manually resize the table at any time by clicking and dragging from the bottom right corner of the table.
There are tons of resources of Excel tables online, and it's a pretty useful tool in Excel.
Hope that achieves what you were looking for.
I am trying to write a VBA code that would allow me to hide all columns containing whatever text/option has been selected from a drop down list in excel.
For example, all the drop down list options are within columns I:FT. The drop down list contains "Cat", "Dog", "Horse", "Fish", " " <—blanks. If I am selected on the blank " " option in the drop down list then I want to hide all columns in “I:FT” containing blanks.
When it does hide the columns containing blanks, all rows in the column must be blank when the I:FT range is selected. The range of these cells are 416R x 169C.
Additionally, I need it to only account for visible rows. I want it to have the ability to filter on a column (such as part number) and have the macro run and only hide the columns with blanks based off whatever is shown from the filtered part number.
The drop down list is associated cell H2 and the list is on another sheet in the background
I am fairly new to writing VBA code and any help would be MUCH appreciated.
Thank you !
To get you started, see the recently answered question about hiding rows based upon a drop down box. You can use this to adapt it for your own purposes.
Multiple Non-contiguous rows in excel Based on cell value
If the columns may change order from time to time, then hard coding the column numbers would not be sufficient. In that case, you could use a couple of methods to make sure the correct column(s) is hidden, which would work by assigning the columns to named ranges first:
Worksheet.Range("CELL REFERENCE FOR 1st ROW").EntireColumn.Hidden = True
Worksheet.Columns("COLUMN REFERENCE").Hidden = True
Once you have attempted that and are still stuck. Come back here, explain your progress and share what VBA code you have written so far.
I use a table for work that has about 10 rows but I want to expand it to as high as 200. I use this table to keep track of specific tickets that I need to work on that shows me the status and follow up date. I use formulas in the adjacent cells to give me follow-up dates and specific comments based on the values of the first 3 cells in the row.
This is basically what I am trying to have setup... The first column of the table has a shape/button with a macro attached to it. I use this macro to clear the contents of the next 3 cells to the right of it. I want a button for each row of the data table to use as a simple way to delete entries. I use another macro to sort the table so that there are no blank entries between others in the table.
I use this code to clear the contents and have to edit it for a new row:
Range("B4,C4,D4").Select
Selection.ClearContents
Is there an easier method to accomplish this without having to write a macro for each of the buttons for the rows next to it?
I have a set of 100 part numbers in a particular sheet and want to eliminate the data corresponding to those 100 part numbers from my Master Part List sheet (which contains a huge list of parts). I don't know how to proceed for this?
The Advanced Filter will do this for you fairly easily. If you have a sheet with the part numbers listed, you can use that as the criteria range. Once filtered, simply delete the visible rows and remove the filter.
Advanced Filter setup
Delete visible rows
Once deleted, you can clear the filter to get back to normal.
You can run a LOOP to go through and delete the rows with the corresponding parts. I'm practicing VBA, but this should be exactly what you want.
Edited out incorrect code.
Good Morning,
I have a spreadsheet with 40,000 products and a spreadsheet with 35,000 products all with item ID's
Is there anyway I can add in the missing 5,000 ITEM ID's using a forumla? I dont want to manually go through each item and see what is missing
Thank you very much for your time and help
Cheers
If ColumnA holds the unique ID's in each sheet please try:
=COUNTIF(Sheet1!A:A,A1)
in Sheet2 and
=COUNTIF(Sheet2!A:A,A1)
in Sheet1, both copied down to suit.
Then sort both on the results of these columns and copy those that result in 0 from one sheet to the other to ensure complete sets in both sheets and to check whether either sheet has duplicates.
next to column "A" in your longer list, put a formula in cell B1 assuming your data starts from A1:
=if(isna(VLOOKUP(A1,**column A of first shorter list**,1,false)),"Missing","Exists")
and populate down until the end of the list, the entries reading "missing" are the ones that are missing from the first list.
I assume your list of source IDs lays in Sheet1!A2:A40001, row 1 is for headers. The target IDs are in Sheet2!A2:A35001
Detect which are missing.
Use the following formula in Sheet1!B2:
=MATCH($A2,Sheet2!$A$2:$A$35001,0)
Copy down to Sheet1!B2:B40001.
Filter out those already present.
Select row Sheet1!1:1. Use Data -> Filter. Go to the drop-down arrow in cell B1, and select only #N/A.
Copy those missing.
Select all values shown in column Sheet1!A:A. Copy, and paste below the last value in column Sheet2!A:A.
It is easy to figure out how to do the same if you have adjacent columns with relevant data that you want to copy as well.