+ Reply to 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

    Red face Alternating color of lines

    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 also tell me what I did wrong!

    To those who read the previous one:
    Sorry about the code... I used the forum 2 years ago, but it wasn't like this.. (as far as I can remember!) Hope it satifies the rules now...It said not to reply... hope that starting a new thread isn't bad either! So here it is again!

    Please Login or Register  to view this content.
    Thanx A LOT!
    Last edited by anmck; 10-04-2008 at 09:20 PM.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Conditional formating can do what you want
    have a lok at
    http://www.techonthenet.com/excel/qu...nd_format2.php

    The resaon your macro did not compile is that certain words are reserved for Excel & or VBA and should nevewr be used as a variable name

    Count is reserved - Whist you can use it as a variable name you should not
    End is reserved and can never be used as avariable name - This variable name is what is causing your problem

    This is the code I would to do it

    Please Login or Register  to view this content.
    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.

+ Reply to 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, 07:35 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