+ Reply to Thread
Results 1 to 7 of 7

Fonts and colouring

  1. #1
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Fonts and colouring

    Hello everyone.

    I would like to use VBA code to automatically highlight every other row in say "light blue" and change the font of the worksheet, so that all numbers have commas and negative numbers are in red. However there are several columns which contain dates, and they need to remain unchanged - they are : V, W, X, and Z.

    This needs to happen in the following worksheet which is created ( only poart of the code is shown)

    Please Login or Register  to view this content.
    I have tried the following but it does not work.

    Please Login or Register  to view this content.
    Any suggestions would be appreciated.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,021

    Re: Fonts and colouring

    In what way does it not work? If it's just that it changes the date formats, then you can reset those columns afterwards:
    Please Login or Register  to view this content.
    for example.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Re: Fonts and colouring

    Thanks I'll give that a go. But what about highlighting every other row?

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,021

    Re: Fonts and colouring

    You could use a template workbook for that and set it up using Conditional Formatting and then create a new workbook from the template each time rather than using the default blank workbook? (You could also set up the number formats in advance too)

  5. #5
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Re: Fonts and colouring

    Huh? I thought the best approach would be code?

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,021

    Re: Fonts and colouring

    Depends on your definition of 'best'.
    If you use a template approach, then if you need to make changes to the formatting, you can just alter the template and leave the code alone. Up to you which you prefer though.

  7. #7
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Re: Fonts and colouring

    Actually I need the rows to be highlighted within this chunk of code. I need the first row to be a different colour than the other rows.

    Please Login or Register  to view this content.
    Trying to learn as much VBA as I can , so I would prefer code.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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