Consulting

Results 1 to 3 of 3

Thread: macro to conditonal format and negative numbers

  1. #1
    VBAX Tutor
    Joined
    Aug 2007
    Posts
    294
    Location

    macro to conditonal format and negative numbers

    Hi

    Need a macro that will do the following steps for the following range of data:- Using column A

    1. conditonal format any Zero (0) values in column J from J2 onwards until last cell - based on column A

    2. range J2:AA last cell (based on column A) show all negative numbers i.e. -143.90 as (143.90) in red.

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    I don't understand what "based on column A" means.

    maybe a sample workbook with sample sheets, one before and one after.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Dim i As Long
    Dim LastRow As Long

    With ActiveSheet

    LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
    .Range("J2").Resize(LastRow - 1, 18).NumberFormat = "#,##0.00;[Red](#,##0.00)"
    End With
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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