Consulting

Results 1 to 3 of 3

Thread: Colour cell in column F if any value in cloumn J

  1. #1
    VBAX Tutor
    Joined
    Jan 2006
    Posts
    248
    Location

    Colour cell in column F if any value in cloumn J

    I am trying to get a cell in column F coloured black if there is any value in the same row of column J, I have a worksheet change macro that does this fine but want to use a worksheet activate macro to acheive another project, I have tried altering the worksheet change macro to the below code with no luck.

    Could someone steer me in the right direction with this.

    It is bugging out on
    If target.Column = 10
    Thanks
    Private Sub worksheet_activate()
    If target.Column = 10 Then target.Offset(, -4).Resize(, 1).Interior.ColorIndex = 1 * Abs(target.Value >= 0)
    End Sub

  2. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    I would use conditional formatting.
    Put CF on F1 with the formula =(LEN($J1)>0) and then copy that CF to all the other cells of column F

  3. #3
    VBAX Tutor
    Joined
    Jan 2006
    Posts
    248
    Location
    Thanks Mike I'll go with that and marked it as solved.

Posting Permissions

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