Posts by Carim

    Re: Moving data from one cell to another based on month selected


    Hi,


    In essence you need to move your data to Column C ..., you could test following :


    Code
    Sub DataMove()
    Range("D8:D10").Cut Destination:=Range("C8")
    Range("D14:D21").Cut Destination:=Range("C14")
    Range("D26:D30").Cut Destination:=Range("C26")
    Range("D34:D39").Cut Destination:=Range("C34")
    Range("D44:D50").Cut Destination:=Range("C44")
    End Sub


    The second question would be do you need a worksheet event macro whenever cell B3 is modified ...?


    HTH

    Re: Fill Textboxes Dynamically


    Hi,


    You could test the following :


    Code
    Dim i As Long 
    For i = 1 To 30 
        Me.Controls("TextBox" & i).Value = Sheets("menu_numbers").Range("A" & i +1).Value 
    Next i


    HTH

    Re: SUMPRODUCT Formula works, include date format


    Hi,


    Not sure to fully understand your question ...


    If your question relates to extracting the date, you can use =INT(yourdate) ...


    and if your want o extract the time, you can use =MOD(yourdate,1)


    HTH

    Re: Locked combobox


    Hi Marti,


    You could test ...

    Code
    Private Sub Frame1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    ComboBox1.Locked = False
    If OptionButton1.Value = False And OptionButton2.Value = False Then ComboBox1.Locked = True
    End Sub


    HTH

    Re: ComboBox with complicated problem


    Hello again,


    Following an excellent remark from cytop, to be on the safe side, you should test:

    Code
    Private Sub ComboBox4_Change() 
        TextBox23.Value = Val(ComboBox4.Value) * Val(TextBox26.Value) 
        TextBox24.Value = Val(TextBox22.Value) + Val(TextBox23.Value) 
    End Sub


    HTH

    Re: ComboBox with complicated problem


    Hello Marti,


    A second test ...

    Code
    Private Sub ComboBox4_Change()
        TextBox23.Value = ComboBox4.Value * CLng(TextBox26.Value)
        TextBox24.Value = CLng(TextBox22.Value) + CLng(TextBox23.Value)
    End Sub


    HTH

    Re: ComboBox with complicated problem


    Hi Marti,


    You could test the following :

    Code
    Private Sub ComboBox4_Change()
    TextBox23.Value = ComboBox4.Value * TextBox26
    TextBox24.Value = TextBox22.Value + TextBox23.Value
    End Sub


    HTH

    Re: Setting colors of cell interior in other sheets


    Hi,


    In the module ThisWorkbook .... Ten_skoroszyt ... (my Polish is very weak ...) :wink:



    Hope this will help


    :smile:

    Re: Sum from match to last row


    Glad this could help you solve your problem ...:smile:


    The Offset function requires a starting point A1, then the number of rows, and the number of columns ...


    In this case, MATCH("a",A1:A20,0)-1 will generate the number of rows ... to reach the starting row ...


    Without this issue of matching the starting row ... your formula would be =SUMPRODUCT((A1:A10="a")*(A1:A10="x")*(B1:B10))


    Hope this clarifies ...


    Happy Holidays ... to you too ... :smile:

    Re: Sum from match to last row


    An attempt within a single formula ...


    =SUMPRODUCT(((OFFSET(A1,MATCH("a",A1:A20,0)-1,0):A10="a")+(OFFSET(A1,MATCH("a",A1:A20,0)-1,0):A10="x"))*(OFFSET(B1,MATCH("a",A1:A20,0)-1,0):B10))


    Obviously "a" has to be replaced by a cell containing "a" or "b" or "c" ... since "x" seems to be fixed ...


    Does it produce the expected result ?

    Re: Sum from match to last row


    A basic UDF could like the following :


    Hopefully, the result is correct ...


    Now, for a non-UDF solution ... do you mind if there is a helper column ?


    HTH

    Re: Sum from match to last row


    Hi,


    Sorry I did not realize there was one more condition ... the non matching rows ...


    Your life would be easier with a UDF ... :smile:


    Are you familiar enough with macros ... or would you like an example ...?