Insert New Row With String Based On Conditional Statement
Sep 6, 2008
I've been working on this project to propagate certain products through multiple categories. I chose to use excel to assign multiple categories to each product. On sheet1 I have setup products (column a) and qualifiers in the following columns (color, model, etc). What I would like to achieve is for the user to select yes or no for each category column and and if yes then have the corresponding category breadcrumb string (from sheet2) inserted into one specific column in sheet3. As the user continues to select multiple "yes" from the category columns for that single product, those additional category breadcrumbs get inserted at the end of the list in sheet3.
In excel macro, I am trying to input data into sql server from excel ADO what is the correct syntax for an insert statement using string sql? This table has two columns supplier ID autonumber and desc as varchar.
I am trying to pull certain members loads from our global design force spreadsheet and because of the naming convention we used for our structural members the 2nd to last character is unique to what I am looking for. I am trying to get a simple condition statement that will display the load only if the 2nd to last character of the name of the element is satisfied.
For Example, if "T" is what I am looking for then :
EDT4 will be true and give me the value accordingly D10T1 Will also be true and return me the value D10B2 Will not be true
I know how to use the Mid() and right() function, but I need to check the 2nd from the right.
I want to copy a row based on a certain condition. I have 700 rows of data on sheet 1. If Cells in column A contain an X, copy row A# to sheet 2. If there are more than cell that has an X copy all of the rows, naturally. Can this be done with a simple conditional statement, or am I going to need to generate an array, then write that array to sheet 2?
I'd like to adapt my macro so that it would insert a blank row after it detects the the first 16 characters of text as "'Closing Balance"; or it could even detect "'Closing" as the first 8 characters if it would be simpler
The Data Begins in Row 5 of Column A
My Current Macro is as below which I have adapted from another one I used
It is not working since it is detecting for the exact text "'Closing Balance" whereas the data registry would write "'Closing Balance as at 31/10/2009" , of which the "as at dd/mm/yyyy" portion would change every time a report is exported, but the first part "'Closing Balance" or even just the word "'Closing" will always be the same.
I'm working on some code that's part of a userform. To illustrate what I need, I will give an example. A column letter, 'J' for example, is stored in colNum.Value taken from the userform. I need both a column inserted before column J, and data entered into that new column in row 2 (thus J2, which would now be blank).
Cell BM22 is a percentage calculation of the differences between two different days of volume for this stock and that formula is: =(BH22/BH25)-1 Cell BM22 currently is calculating the result to be -65.65%
When I set up a CLASSIC Conditional Formatting using a formula (="If($BJ$20=""SELL""") to check the if the text in cells BK10 match the text displayed in cell BJ20 - I get no error messages and no formatting?
I am using Mac Office Excel 2011. I feel like I have tried everything including changing the Number selection type of the cells to TEXT. Nothing seems to works.
I'm racking my brains as to how I can structure a formula to conditionally rank a value in an array against only those values in the array whose corresponding criteria cell includes a specific letter.
So for example I have a list of 12 values, say 126; 239; 0; 171; 162; 157; 130; 199; 122; 153; 0; 15. Each of those values corresponds to a heading, say: CDE; DFE; FGE; DFE; ERD; DEA; BDF; DFB; CDE; CEF; CAB; FAB. As you will note some of the headings may or may not be the same and may or may not include the same letters in different orders.
How can I write a formula that ranks in ascending order a given value drawn from the above list (which will be in another cell but which in this case is, let's say, the first value: 126) only against those values whose heading includes a specific character, for example the character C (the character in question will vary and be defined in a specific cell).
As an added complication I need the ranking calculation to exclude any zero values. So in the above example what the formula needs to do is rank the value 126 against a sub-set of the whole array comprising only the values 126; 122; 153; 0.
The answer I need is 2 because, discounting the zero value, 126 is the second highest value.
I have a workbook that I've built for a project. I've attached a sample workbook. What I'm trying to do, for the entire sheet or workbook if possible, is turn any Cell with a percentage of 30% to 49% yellow and any cell with a percentage of 50% or more Red. I would also like to move the ID's of the variable cells, for example Id number 9922, to the cells beside the description of the rows, Affected would be an example, if the information contained in the same row as the ID meets with a set of variables.
For example I only want the ID's moved if they correspond with IDsub 1-25. One more thing, the people who will be using this spreadsheet will be copying data from a website when it is imported it does not insert the values as numbers. I would like to format the cells, in example workbook they would be any of the cells labeled ID IDsub Variable or Number, so that anything put in that cell will automatically be converted to a number.
I should also probably add that the formatting will be done on approximately 80 rows a sheet with 47 sheets.
I have a spreadsheet which has "Employee: [agent 1 name]" in column A and it may or may not have the word "Break" in the same column before it mentions "Employee: [agent 2 name]". The amount of data between agent 1 and agent 2 varies and am needing code which will insert a row above "Employee: [agent 2 name]" if "Break" is not found, and add the word "Break" in column A on the inserted row. I would need this to loop through the spreadsheet until all 100+ agents have been searched.
I'm also needing this done for the word "Meeting" and would insert a row 2 rows above the next agent.
I'm using a userform to create a new sheet. The form already creates the sheet and names it what was typed into the userform. Now I want it to place that variable in a cell along with a string. the following code will place the variable from the form (tbname) into cell b5.
I need to create a string of all the Acc Number but I dun not wan any repeat of the same Acc number in the String . The number of Acc number to be put in the string may varies sometimes. It may varies from 3 to 1000 or more . Is there a way to write a general formula to create such string?
Working with a scheduling report and trying ultimately to get it down to a line item report with the associate information and their earliest start and latest end for the week. Already made a lot of fixes to the formatting involving junking empty cells and trash data, but running into a road block on some of the trash data.
Here is the format of the report at this point. Names have been changed to protect the innocent.
Agent: 2366 Bacon, Kevin
Date Start End
So what I need is something that will iterate through the report...such as an while and find the cells in column A that start with "Agent:" It needs to compare that cell to a stored value to see if this "Agent:" is a repeat. If it is then it needs to delete that row and the next one and shift up. If it is not then it overwrites this "Agent:" with the previous one in the stored value and continues the while.
I know what I want to do...but not shure on the code cause I am not great at VBA.
Oh...if it matters probably need to allow for about 10k line items to iterate through...right now report is at 6k...but allow room to grow.
I am working on a search and replace macro. It's purpose is that within a region that varies only in row size, it's suppose to compare two values, A and B. A is only placed in one cell in the region, while B is a one column range in the region.
If A <> B, A should replace all B's in the region.
These regions are placed on top of each other in a long table. Please see the sample workbook, SampleDRW.xlsm
The code I am using is this:
The problem is if the B value in the next region is the same as the one before but the A value change, my code don't pick up on it, because it only looks for changing B!
How can I expand the code to also pick up on this problem?
I have the following code to execute a connection to a DB and return the result of the SQL statement. I have a variable in the statement that I want to be able to change from user input in a single cell. Unfortunately I am unable to get this to work.
This fails and gives me a debug error, however if I declare the condition I want the code executes fine. This would mean having to update the code every time the condition changed or putting the whole query in a cell on the sheet which I do not want to do.
Wondering if it is possible to generate a random 4 digit number based off an alphanumeric string?
Cell A1 has 123XVF1234 Cell A2 has 321AFW4321
In B1 I would like to have a 4-6 digit number that is generated based on the alphanumeric data in Cell A1 (and so on down the list). If that is possible, I would also need to be able to convert back the 4-6 digit number back to its original alphanumeric value
If B1 returns 643562 it would need to be able to be converted back to 123XVF1234
I have to determine based on average number of weeks on hand whether an Item is Overstock, Obsolete, or Normal. I've got that taken care of with some If statements (I'm sure there's a cleaner way to do this but I've not figured that out yet.)
But I need my if statements to be conditional to whether or not an item is seasonal. with 10,000 active SKU's Its a little bit much to manage those in my excel copy of the item table so I wanted to make an exclusion table where I could just key the item in and the months it would be considered active in stock. This needs to go into the If statement on the items table that looks at the current date and says if it's less than six months old it's a "new item" but if it's six months and a day then it's a normal item, then ignore both if it's seasonal and just be a seasonal item if it is on the exclusion worksheet.
I'm attaching this incase anyone can offer any ideas. It would be much appreciated. I had to delete a ton off of the spread sheet to get it to upload, and the data is dummied to keep company inventory confiential.
I have a column with different letters in it. If this column DOES NOT have an L, H or F than I would like it to add a K. If the column DOES have a an L, H or F then I would like it to remain as is and not add the K.
I wish to use a formula to highlight a date based on two criteria in two separate columns;
The first is the Date that will be in Column B.
I want it to highlight the date if : Today() is greater than that date in the cell plus 5 years (or 1824 days)
The second criteria I want is for the date to be only highlighted if the corresponding cell (in column A) does NOT contain the term ("Basic")
I have the formula:
which highlights the date correctly IF the term in Column A is "Basic" : But I cannot figure out how to insert the NOT statement to make the formula flip around so it only highlights those dates older than the 5 years requirement and NOT contain the "Basic" in column A.
I have several rows with data in and what I would like would be to total the amount of time "CU" is displayed and if that number is less than say 10 the formatting is applied. I need if possible to be able to do this via the one condition.
Can you do a IF statement in Conditional Formatting? I need a column to highlight Red if there is a blank in it based on the current time COMPARED to the stated time in another column (on a separate tab)
So if current time is 1:30 PM and the stated (appointment) time on the other sheet is 1:15 PM, and my control field is still blank, I need it to turn Red.
I guess because I use a drop down box and another cell reference for the date, my IF/AND statement isn't recognizing the date and therefore gives me a "FALSE" result. I have the date formatted as a date.
I've tried referring to cell I2 which is the drop down box - that doesn't work. I've tried using quotes around the date as if it were text - that doesn't work. If I use just the w10=3 part, that'll work fine but it must be associated with the proper week otherwise every 3rd of the month that falls on a friday will be a holiday.
I want to conditional format cells with an if statement (something to that nature). I attached an excel file to aid in my question. Basically I want it to be color coded to alert users Red if no action is required because info is left out Yellow if info is available so take action Green if all is complete and nothing needs to be done.
If G2 does NOT have data then cell H2 has red fill If G2 does have data then cell H2 has yellow fill And finally if I2 is filled out cells A2:I2 are green filled
I am trying to find a way where I can just enter the information into one and have it flood to the other.
worksheetA is the master sheet which contains data on all accounts - the order and number of entries on this account changes monthly. worksheetB shows data only on a single account.
What I am looking to do is to take the account name from worksheetB find the data I entered in worksheetA and have that flow to the apporitate cells in worksheetB.
Something like this
cell on worksheetB displaying number of vehicles - if worksheetB(cell with the account name) = worksheetA(range of cells with multiplenames) if the two match somewhere on the list then display the number of vehicles from a cell in another coloum same row.
sorry if its confusing, tried my best to explain it. I'm sure it can be done with VB but just don't know that one much, is the syntax and language similar to the old ms basic?