Closed Thread
Results 1 to 2 of 2

Alternating color of lines

  1. #1
    Registered User
    Join Date
    10-04-2008
    Location
    Laval, Qc CANADA
    Posts
    34

    Question Alternating color of lines

    Hi there!

    I need to write a macro in order to format a worksheet so that the line colors are alternating (ex: grey and white), for easy reading after print. However, the file will be change constantly by people that don't care much about formating colors....So I want to assing this macro to a button (I know how to do this part!)

    I tried, but it didn't compile, and I couldn't get it right...

    NOTE: The selection should start not from the begining (ex: line 4) and be applied until it meets an empty field in the A column.

    Here is what it looked like.... I can do with a brand new code, but I would learn better if someone can tell me what I did wrong!

    Dim Count As Integer, End As Integer
    Count = 4

    Do
    Rows("Count:Count").Select
    Selection.Interior.ColorIndex = 15
    Count = Count + 2
    Loop Until IsEmpty("ACount")

    End = 5
    Do
    Rows("End:End").Select
    Selection.Interior.ColorIndex = xlNone
    End = End + 2
    Loop Until Count < End

    THANX!

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Welcome to Exceltip forum

    Please take a couple of minutes and read the Forum Rules then wrap your VBA code (Rule 3)

    Thread Closed

    anmck

    Posted new thread
    Last edited by mudraker; 10-04-2008 at 08:42 PM.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Multiple lines in single cell
    By Bill Pearce in forum Excel General
    Replies: 5
    Last Post: 04-02-2015, 10:59 AM
  2. Pasting multiple lines of text into one cell
    By hoopz in forum Excel General
    Replies: 4
    Last Post: 07-11-2012, 08:28 PM
  3. Alternating color of lines
    By anmck in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-04-2008, 08:53 PM
  4. copying and inserting huge amount of lines
    By Guy in forum Excel General
    Replies: 0
    Last Post: 08-14-2008, 02:32 PM
  5. Extracting specific lines from datasheet
    By SlipperyPete in forum Excel General
    Replies: 5
    Last Post: 12-21-2006, 10:54 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1