I would like to check whether 2 conditions are satisfy in an if statement. One condition is of data type text and it is stored in a variable calls search1 whereas the other condition is of data type date and i intend to store into a variable calls search2. Could someone tell how to put search 2 into the below code. Basically, i want it to be like
if Cell A is equal to search1 and CellB is equal to search2 then
return value that is associated with the search in cell c
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?
Ok ive been playing about with excel for the past week to get a spreadsheep up and running so i can see the totals of some things and now its getting a little complecated for me (ive done the easy stuff lol)
Ok here is the situation and i'll try and explain what im doing as best as i can. Im trying to make a spreadsheet that shows how much a resorce can be refined so lets say in a1 to c1 i have 400 in each but i can mix a with b and b with c at the ratio of every 20 of a and c to ever 10 of b
so somewhere in my spread sheet id have the result 20 and 20 as products ato c can make 20 of product d and e i hope that makes sence?
for every 20 + 10 of a(400)+b(400) = 20 and for every 20 + 10 of c(400)+b(400) = 20
so if i had 600 300 600 instead of 400 i can only make 30 of product d of e (id have to choose)
I need to format the background color of a row using an if statement or something similar. If have a certain cell has a specific value I want the entire row that the cell is on to have a specific background color.
How can I write the equivelant of an if(and( statment in VB? What I would imaging it would look like is this...
If _________ = true
AndIf ________ = true Then
____________
End if
It seems like this should be simple, but after searching, and searching the help files, the internet, and this website, I am no closer to figuring this out.
I have another question with my red sox scores excel sheet. On my overview I want to be able to select any team, and view the indiviual stats against them. For the life of me I dont' know/can't find how to even do a simple yes no if statment to what the value in the drop down menu box is.
I don't even know if using the IF statement is the right function, but anyway. I am using VLOOKUP to complete a supply list, but of course if the supply name isn't on the first spreadsheet then the result is NA. Instead I want it to return 0.
why the code below is very slow with the extra if statment in it (marked with **) i have googled around and found that my for staments are correct i have tried screen updating etc. i have added a timer to see what diffrence it makes, what i have is 3 sheets 1st has about 100 rows with a number and time same as second but that only has 2 rows of the same the 3rd sheet has about 100 rows of just a number what the code does is loop through the 3rd sheet (build list) when it finds a number it looks on the first sheet to find the same number then gets the data in the second coloum and so on until it reaches a cell that says stop.
i have added a button to start this process, with the ** line in it takes 311 seconds with out it it takes 0.17 seconds
I have a list of codes. Some of them may be duplicated. I want to use the conditional formatting and the IF statement to highlight in a particular colour any codes that have appear twice or more. I used to know how to do this but now I cannot get it right.
I have been trying to get a formatting programme to work for well over a week and no matter what I try I seem destined to fail. I am trying to use an IF statement in VBA to format a cell if the result of the IF is true. The values in the cells being formatted have been generated from a VLOOKUP statment (looking at a table on another sheet of the workbook). I have tried to use conditional formatting but cannot get past the limit of 3 conditions.
Note in the code below I have values that may appear the same but to make them unique they have a single (or double) space before and after the character. Not sure if the code I have below is workable, if anyone has a better idea please let me know (its a little long winded). I am currently self learning VBA (through forums and the like) and below is the best I have come up with... however when I try to run it I only get a Run-time error 1004, application-defined or object defined error.
I am trying to use an IF statment to look at 2 values, 1 from a defined range and the second based on offsetting the the first to Format a number of cells with a worksheet. Affectivley if the First Value is "E" and the value two columns to the left is a Sat or Sun I wish to format the row slightly differently from if it is a weekday. (There will be an M and a L as well)
If you look in the file you will see a records sheets and a form sheet. I want to see if a record has been broken. All the times are in seconds and the distances are in centimeters. How can I find a certain row, compare and act based on an if statment?
I would like to highlight cells is two conditions are met:Cell = 0Offset(0,-1)>0I tried the conditional format wizard and entered a formula: =IF(AND($J2=0,$I2>0)) But I keep receiving formual errors, which I understand, because it appears to be incomplete formula. But I am not sure what else I need to add to the formula in the conditional format wizard
I want to know that are there anyway I can quickly declare the header row of the sheet into a string instead go through each one of them using dim xxxxx AS String?
Attached is a small sample, how to put the text from A1 to combobox1, the text from A2 to combobox2 and so on
Up to combobox6, when the form loads. but be able to change the text A1 thru A6, and no matter what text I put in A1 thru A6 the form loads with whatever text is there, is that possible?
I tried to put the following formula into a cell using vba, but I received alot of errors. here is the formula I am trying to put into a certain cell and I will use a variable to replace the row number in the formula
The code below places a spinbutton on the worksheet. The linked cell = F10 This works ok. The orientation is vertical and max is 100 However I would like to set the orientation to horizontal and the max value to 1500. Which commands must be added for this in the macro below? I work with Excel2000.
I have 2 columns of data in an excel sheet and I wish to add this to a userform so that the userform displays the 2 columns beside each other with headings, like a table. The user should then be able to select a particular row and insert it into the specified cell.
I would also like the user to select a row on the table and then be able to bring up another table depending on the row selected...basically so that the user can draw deeper into the information that they require.
Is there any way for me to put a date in the userform? I created 3 combo boxes (day, month year). I would want it to appear as one date in one single cell in the another sheet as the date the entry was updated in the userform.
I would like to write a macro that would start by asking me something along the lines of, "Enter student # you want to print a report about." The # I enter would need to be stored as a variable in the VB code, and then my code would need to use the variable to do some search and replace operations. (Replace all instances of 10 (the default student number) with the variable I have specified).
I don't really know how to even start going about this. How do I get Excel to ask me for a variable, and then use that variable in code?
How can I stop #DIV/0! in a cell which has a formula relating to a cell which will have a number inputted but at the moment is empty, without me putting a '0' in?
When I try to run the macro, an error comes up saying application-defined or object-defined error. The following code is the line in which I receive the error.
VB : tool.Worksheets("ALL").Cells(row1, "J").Formula = "='[TRB Database.xlsm]TRB Database'!$I$" & A
I am having trouble being able to put data into a table. The data I have breaks down orders of products in crates into lots of 45 crates with a remainder.
I would like to be able to fill a table from left to right which displays the item number with the corresponding amount of crates, which seamlessly goes from one item to the next.