Results 1 to 6 of 6

Thread: Color i cell

  1. #1
    Join Date
    Oct 2003
    Posts
    3

    Unanswered: Color i cell

    Hi, i'm wondering if its possible to easy make every second cell gray?

  2. #2
    Join Date
    Aug 2003
    Posts
    106

    Make cells grey

    You can write a macro.

    Dim myRow as Integer

    Cells(1, 1).Activate 'Set the starting cell

    myRow = 0
    Do
    myRow=myRow+2

    Cells(myRow, 1).Interior.Colorindex = 15

    Loop Until myRow = 1000 'Number of rows you want to go down

  3. #3
    Join Date
    Sep 2003
    Location
    Cincinnati, Oh USA
    Posts
    203

    Re: Color i cell

    On the outter border of the speadsheet, right click at the intersection of where the row and columns meet. This will highlight the entire sheet. Then click 'format cells' and set the colors.


    Originally posted by Juha
    Hi, i'm wondering if its possible to easy make every second cell gray?

  4. #4
    Join Date
    Oct 2003
    Posts
    3
    Thanks sugarflux
    it works great!

    But just one qusteion, how do i fill like 7 cells i row
    and why cant i fill the cells twice?
    Last edited by Juha; 10-05-03 at 12:51.

  5. #5
    Join Date
    Aug 2003
    Posts
    106
    If you want to fill a group of cells without blanks, you just change the
    myRow = myRow+2 to
    myRow = myRow+1

    If you want to extend the macro to cover columns, you can put the same piece of code in the middle of the original code.
    ie.

    Dim myRow as Integer
    Dim myColumn as Integer

    myRow = 0
    myColumn = 0

    Cells(1, 1).Active ' Set Starting Cell

    Do
    myRow = myRow+1

    Do
    myColumn = myColumn + 1
    Cells(myRow, myColumn).Interior.Colorindex = 15
    Loop Until myColumn = 1000 ' Number of columns

    Loop Until myRow = 1000 ' Number of Rows

    Hope this helps!
    Dan

  6. #6
    Join Date
    Oct 2003
    Posts
    3
    i got it working now....thanks alot sugarflux

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •