• Excel Macro to color my rows (97)

    Author
    Topic
    #385009

    Hello All,

    I’m looking for a macro that will do the following:
    * Starting form the current row
    * color this row light yellow
    * go to next row
    * color this row white
    * go to next row
    * color this row light yellow
    * go to next row
    * ….. until the last row that contains data

    Someone an idea?

    Viewing 1 reply thread
    Author
    Replies
    • #662566

      You can do this without coding using Conditional Formatting, or you can set the conditional formatting in code. See the thread starting at post 27808 for ideas about this. The methods described there do not exactly do what you want, but it is not hard to adapt them to your needs.

    • #662755

      There is an addtional conditional formatting method that will colour alternate rows, and allow automatically for hidden/filtered rows.

      Use a construct like:
      =MOD(SUBTOTAL(3,” & sStart & “:” & sRelative & ” ),” & sBand & ” )=0

      where

      sStart is the absolute address of the of the range to be coloured.
      sRelative is the relative address of the range to be coloured.
      sBand is the number of rows between colouring.

      eg for colouring a2:g10 evey second row green use

      =MOD(SUBTOTAL(3,$A$2:$G10 ),2 )=0

    Viewing 1 reply thread
    Reply To: Excel Macro to color my rows (97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: