5/25/2023 0 Comments Vba find with multiple conditionsSave the Excel sheet as xlsm for Excel 2007 and above (Macro Enabled worksheet). Note that you should set the Constant Replaced (see Const Replaced = 0 ) to the intended value and specify your range at line Set MyRange = Range("B2:F12")Įnsure that the first column of this range is indeed the columns in which you are checking for presence of 18. Set foundItem itemRange. ![]() MyRange.Columns(j).Cells(i).Value = Replaced ![]() This can be applied to the above example by checking if the bad weather is ‘some rain’ AND the rain coat is ready. Instead of checking that condition True, we could check that condition1 True AND condition2 True. Double click on the Module name in left pane to access the code editor. You could specify multiple conditions within the same condition by using AND and OR. In your worksheet press ALT + F11 to access VBA Editor. So if it's 44 it should be ignored and not attempted to be replaced. As you can see, only three employees met the conditions to get a 10 increment and the rest of them are getting a 5.5 increment. I assume you are searching for actual Number 4 and not a character 4. Based on my understanding of your question, I am suggesting a VBA Macro to automate this task.
0 Comments
Leave a Reply. |