Using A Formula To Populate A Cell With Certain Data Based On Content Of Another Cell?
Jul 7, 2014
I am currently trying to create a spreadsheet whereby if I enter certain text in a cell in Column A on worksheet 1 that correlates with text in a cell in Column A on Worksheet 2, then the description in Column B in Worksheet 2 is entered into Column B on worksheet 1.
For example, if worksheet 2 has the following:
Column A Column B
XXXX PRODUCT 1
YYYY PRODUCT 2
and I enter XXXX in column A on worksheet 1, I want Column B on worksheet 1 to automatically enter PRODUCT 1.
Is there a way to make a cell populate certain text based on conditions of other cells without putting the formula in the cell you want to populate. So that someone could type other text into the cell if the conditions were not met?
And I have set up a seperate worksheet (2) as an invoice. What I have been trying to do is when I enter a qty in worksheet (1), worksheet (2) will reconise an entry in the qty colum an copy selected fields/ cells. I can do a "=" or use an "if" statement looking at anything greater than "0". but is there a way I can get the invoice worksheet to ignore any lines with "0". So it will only copy over the information with only qtys for the invoice ?.
I have a sheet which is running a a query against an external source, and coming back with a list of client data. Each row is an investment with it's own unique InvestmentID number and a ClientID number. Each client has their own unique ClientID, however may have multiple investments (InvestmentID) linked to their ClientID (does that make any sense?!).
Anyway, the query I have returns ALL investments. I know how to manually change this to only bring back certain client(s), however I want to be able to have the users (who don't know what a query is, yet alone to how to use/edit one) enter a ClientID into say, cell B2 and have the query reflect that ClientID. If they have to click a button to run a macro after entering the ClientID, so be it (although it'd be great if it actioned once they hit "Enter").
I know this is possible because I've used something similar before (that someone else created!). What I don't know is... if I had multiple "entry cells", could I have the query filter by two (or more?) ClientIDs? That is, they enter the first ClientID in B2 and the second ClientID in C2, the query then returns all information relating to B2 or C2
I have a spreadsheet with data populated down column B. This size will vary from day to day so is there a macro I can run that will populate Column C with a formula based on their being data in the adjacent cell.
Formula/macro/etc that would enable me to have content of a cell changed based on the content of another cell in the same row.
Example: cell in column D says "PSA" - so I would need the cell in column H for that same row to read "Radio"
I would need an entire sheet scanned to review for these occurrences and make the appropriate changes. I also would need the formula to be inclusive enough to scan for variations in column D cell content (PSA 1, PSA 2, etc).
PHP Sub Macro1() Macro1 Macro Dim strbody As String For Each cell In Range("B2:B640") Sheets("MASTER").Select Cells.Select Selection.Copy Sheets("Final Merged").Select Sheets.Add ActiveSheet.Paste Next End Sub
The code above is creating a new sheet for each different value in column B. I would also like to take that value and place on the newly created sheet in cell A17.
Also, how would I get the sheet to be ranamed to match the value in cell A17 of the newly created sheet?
I am working on developing QR Codes using some MATLAB code and it would be really convenient if I could create an excel program which changed the background color of a cell containing a 1 to black and a cell containing a 0 to white.
multiple search match and replace content in a different column so for example
new workbook (look up table) sku search1 search2
so something like where you compare two tables and find and replace based on another cell that matches in my sku.. more details would be if the table column aren't exactly matching but the column header and the row header would match and fill or replace in the correct/corresponding cell is there a macro or vba to do this job in excel?
How to determine the correct formula for this requirement?
Assuming I have 2 individual excel files and an index excel file (in reality, there are more than hundreds of file). For index excel, once the user enter part number (eg. 1 or 2), the excel will look for the part number excel file and determine vlookup function.
The only problem I have here is I can not make the index file automatically add the part number shown on most left column into the required formula (replace the part number file section).
I tried use the indirect function but this require each file to be opened, which is not possible for actual use. I am looking for a function that can work in closed worksheet.
I have a sheet that I fill out with customer data then print and start over with the next customer. This requires me to tab and delete through the sheet before starting the next entry and I am wondering if there is some way to auto clear the unlocked cells based on a single entry IE when we entered new data in the 1st field this would clear the unlocked cells and make them ready for new data?
I have a cell A1 in sheet2 linked cell A1 in sheet1 (simply A1='sheet1'!A1). A1 in sheet1 is a data validation drop down menu.
I want to clear the content of A2 in sheet 2 everytime the content of A1 in sheet2 changes/is updated. That is everytime the value of A1 in sheet1 is changed using the drop down menu.
I tried using a Worksheet_Change event macro (which I do not fully understand) but it won't work with a cell that updates from a calculation. It also doesn't work if triggered from a cell from another worksheet (I tried linking it to cell A1 on sheet1 in this case).
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub If Target.Count > 1 Then Exit Sub Range("A2").ClearContents End Sub
Any simple solution to clear the content of cell A2 in sheet2 when A1 in sheet2 updates?
I have a chart full of different names which I need to separate them by color when a specific entry is found in a Cell. For example the list has the store name "ZELLERS" + its branch number. (ex. ZELLERS #276 PL or ZELLERS #295 SL and so on). I would like to modify the below code so that It only check for the name ZELLERS and not the branch number. If it finds ZELLERS in any cell In the Range of C1:C500 then color it Red.
Below Code does that but I have to write the exact name as it appears in the cell otherwise it wont find it for me. Is there any way to resolve the issue? I am not an Excel Programmer but Only an Excel user.
Option Compare Text Private Sub Worksheet_Change(ByVal Target As Range) Set r = Range("C1:C500") If Intersect(Target, r) Is Nothing Then Exit Sub End If On Error GoTo Endit Application.EnableEvents = False vals = Array("ZELLERS #276 PL", "ZELLERS #295 SL", "Gopher", "Hyena", "Ibex", "Lynx") nums = Array(3, 46, 6, 3, 7, 4, 20, 10, 23, 15) For Each rr In r..........................
I am trying to create a formula that will compute a variance between the numeric value in a given cell with the value in one of 3 other cells depending on the condition of the 1st cell. Example: If the Value in cell F4 has a condition defined as "PMR" in cell C4, subtract the value in cell F19 from F4. If the condition is defined as "DBR" in cell C4, subtract the value in F20 from F4. And if the condition is "OTH", subtarct the value in F21 from F4.
I have a named range (D:16 F:800) called “NameRange” which contains names. I’d like to create a macro which offsets a letter “x”, 10 columns to the right everywhere that name appears within the range. As an example: If I’m trying to find the name Tom, A dropdown menu shows the name “Tom” ( which I’ve created) whereby it calls upon a script to search within the named range from this:
Bob Kim Tom Tom Sue Mary Bill Ted Tom Sue Bob Fred Bill Sue Bob Tom Kim
I have a file consisting of two columns, called, "bom ref" and "material" I need to show the data as indicated in the file, headed required format required.
In effect where I have a 0, that is the material I need to show for every row with a bom ref. of 1,2 or 3, down as far as the next 0 but not including the 0, when I reach the next 0, the material is a new letter, and that letter needs to repeat down as far as the next 0, but not including the 0 and so on.
I am working on a spread sheet for work were we have to test certain items on certain days, e.g. one item needs to be tested every Tuesday & Thursday, when the test is completed you click on a drop down box and click on completed or in progress.
What I would like are a couple of things to happen as follows:
A message box would pop up when you open the file to inform the employee that the test is due today only on Tuesday & Thursday if not completed or in progress from the drop down box. Once you select completed or in progress from the drop down box the message box no longer appears. Every Tuesday & Thursday when it's first open it deletes the cell content, thus triggering the message box test is due today, and once completed or in progress it no longer appears until next Tuesday or Thursday.
The spread sheet is on shared drive and used by several users, let's just say cell A1 is the cell I have the drop down box
I have standardized each existing worksheets and any new worksheet to have certain parameters. The purpose of the Macro requested is ensure these worksheets are sorted alphabetically (and only these worksheets). The code I have been working with is contained below. It is working as expected but now I need to incorporate a statement which places the following condition:
Sort worksheets only if A3 has cell value of eCRF NameIgnore worksheet name: TOC & ENTER ECRF NAME
VB: Sub Sort_Tabs() 'declare our variables Dim i, j As Integer
I want to format a range of cells based on the name listed in a cell in column A (starting @A6). I currently do this manually. It is to help me visually see the line I am working with and for what person.
I am almost certain that is going to take a VBA, but I know little to nothing about setting one up.
I have created two buttons in a worksheet to navigate to two other worksheets. I would like a cell to display 'YES' automatically if one of the two buttons is clicked and or to display 'NO'. I also would like to change the colors of these cells change automatically depending on which button is pressed.
I have a 3 column table with 20 rows. The first two columns contain travel expense data. The cells in the third column are blank exept for whichever cell I enter an "x" in. Please let me what formula or worksheet function do I use to calculate the travel expenses based on the data in the first two columns that correspond to the row of the cell with an "x" in the third column?
I have a large spring-selection table, which is populated with things like "4.88 x 635" and "5.26 x 584". There are 1520 fields in the table populated with any combination of the 432 springs available for selection. The spreadsheet takes my criteria, finds out which springs it's allowed to choose from, and populates the table. It could be 20 springs, could be 30. I'm trying to get the number down to 10. The table updates when I change the criteria.
What I'm after at this point is a macro which will color-code the table based on the cell contents, so that all the "4.88 x 635" have one color and all the "5.26 x 584" have another colour. Doesn't have to be any particular colour, just so long as it's a bit different to the cells around it. how the table reacts.
The biggest spring size is "6.93 x 1727", which could be converted to a color reference, perhaps by adding up all the digits, or taking out the non-digits and dividing by 123781, I don't know I'm thinking out loud. And then just assign the cell color to that number.
Where to start a macro like this. Obviously it would use ActiveCell.Interior.ColorIndex but I can't find anything like this on the web.