Posts by AdamP1027


    I have this VBA (below) which will allow the summing of a list of numbers to reach a stated number.

    When using =getcombination(A2:A9,C2) for example, where A2:A9 is a list of numbers, and C2 is the desired sum

    However, the result is only 1 possible combination (and usually not a desired one). Is there a way to modify the VBA so the 1 combination shown is the result with the fewest number of combinations?

    I know this is so easy, but it seems most people asking for this are asking for more complicated things.

    What's the easiest way to look at column H, if any cell contains a certain word, then clear the whole cell?

    Also, if any cell in column H contains a certain word, delete only that word.

    Found a solution, thanks!


    Please see attached worksheet.

    I need VBA to look at column C. For all entries in column c that are the same, look at corresponding rows in column D, Paste all of those from column D into 1 cell in column F (first row of the associated column C entries), entries to be separated by a semicolon. I typed a couple entries in column F with the results that I want.

    Thanks so much!

    Nm I figured out the problem, something in the new data import from txt was messing up the VBA, I changed it to the legacy import and now the vba works.

    Hi again,

    I have another sheet that I want to do the exact same thing, but the target that changes is B1, and the column that will have matches is A3:A500.

    I tried adjusting the above code with these changes but it's not working, it seems to only color B1. Am I missing something? It seems like it should work.


    Please see attached image.

    Cell A6 changes all the time. Cell A6 will usually match some cell in row B. If A6 does match any cell in row B, that cell in row B needs to be colored green permanently.

    I think I need to insert VBA into the sheet, starting with:

    Private Sub Worksheet_Change(ByVal Target As Range)

    This should trigger the code when target address changes? And then something like this? I'm guessing this will not get it done.

        If Target.Address = "$A:$6" And Range("A6") = Range("?") Then        ?.Interior.ColorIndex = 10    End If
    End Sub

    I have the following code which does something slightly similar but with different criteria and different "then". With enough trial and error I might be able to figure out how to get it transferred into what I need, but I'm guessing some expert here could probably do it in a couple minutes?

    Can anybody write VBA for this?

    [If D10 is greater than 90] or [If E10 equals 2.6 or is greater than 11.99] then fill A10 red
    If A10 is filled red and matches any other values in Column A, fill those red too.
    Repeat for every row after 10