Posts by Ranger

    Re: Ungroup Rows On Cell Click?


    Hi financial host,


    Using the Worksheet_SelectionChange is one way you can do it.


    In the Code, I have used cell E1 as the cell to click. You will have to change this to suit. You will see that it also Activates cell B12, which is a cell within my data range for the Subtotals, again you may have to change this.



    When the user clicks to Add subtotals, the Text in E1 changes to Click to Remove Subtotals and vice versa.


    Bill

    Re: Copy Data From Different Rows Into One


    Hi Caveman,


    Try this:



    Bill

    Re: For Each [element] In [collection]


    All that is missing in your own code is:


    ActiveSheet.Range("B2").Value = 1


    ActiveSheet before the Range statement.


    Bill

    Re: Looking For A Cell In A Group Of Cells


    Hi joshlan,



    Should do that for you.


    Bill

    Re: Change Font Color Based On Conditions


    Hi romy113,


    The following in the Worksheet_Change Event, not SelectionChange event will work.



    Bill

    Re: Find And Replace With Loop


    Hi Shab,


    2 would relate to 02/01/1900


    type in a date in any cell and then format the cell as General and you will see the actual value of the date cell.


    Bill

    Re: Find And Replace With Loop


    Hi Shab620,


    01/01/1900 has a value of 1 in Excel. The cells which have 01/01/1900 actually have a value of 1 in them (a date is just a value), not text "01/01/1900", so the code recognises the value of the cell as 1. Therefore changing the code to look for 1 rather than 01/01/1900 deletes the value and replaces it with a blank cell.


    HTH


    Bill

    Re: Find And Replace With Loop


    Hi Shab620,


    The following code works for it:



    Still looking for a value of 1.


    Bill

    Re: Find And Replace With Loop


    Hi Shab620,


    It is looking for a value in the cell not 01/01/1900, the cell value is 1, so change the code to;


    If Sheets(target_sheet).Cells(rowcn, 5).Value = 1 Then


    and it will work. The only problem is if you have any other cells in that column valued 1.


    Bill

    Re: Skip Blank When Paste


    Hi Tee,


    First problem


    If you want to do it without code, put 3 in any blank cell, select Copy to copy the cell with 3 in it, then Select the Range with the values in it, Select Paste Special|Multiply and OK


    Bill

    Re: Skip Blank When Paste


    Hi Tee,


    For your third problem, you could use the WorkSheet before right click to do it.


    Code
    Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
        Range("A1").Value = WorksheetFunction.Sum(Selection)
        Cancel = True
    End Sub


    Select the range, then Right Click anywhere in the selected range and the Sum will appear in Cell A1


    Bill

    Re: Conditional Formatting With Formulas


    Hi Canadian diva,


    If you put a date in cell K2, then it should not be highlighted, no matter what date you put in it.


    =AND($K2="",$J2+2<TODAY())


    Says that the cell K2 must be blank as well as the date in J2 being more than 2 days before today() before it is highlighted.


    Can you explain more about what is happening?


    Bill

    Re: Sumif If The Row Data Is Live


    Hi richiejjj,


    I may be reading this all wrong, but if you put:


    =IF(E$16>0,E6,"") in cell E18 and =IF(E$16>0,E7,"") in cell E19, then copy along, does that not do it?


    Bill

    Re: Conditional Formatting With Formulas


    Hi Canadian diva,


    =AND($K2="",$J2+2<TODAY())


    Means that cell K2 has to be blank AND the date in cell J2 + 2 days is less that today's date. TODAY() is basically just today's date.


    It could just as easily have been:


    =AND($K2="",$J2<TODAY()-2)


    Where the date in J2 has to be less than today's date minus 2 days


    Today() now would be 24/1/07, TODAY()-2 would be 22/1/07
    if cell J2 date is less than 22/1/07 and K2 is blank then the conditional formatting would come in.


    HTH.


    Bill



    Bill