Consulting

Results 1 to 4 of 4

Thread: Solved: macro to edit background colour

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

    Solved: macro to edit background colour

    see attached workbook
    Hi

    Need a macro that will edit the backgorund colour in row 21:26 column b irrespective where the data lies in column B if records increase or decrease over time.

    So backgound colour transparnet NO FILL.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Are you saying that as you add a new row, it gets coloured and you don't want it to?
    ____________________________________________
    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

  3. #3
    VBAX Tutor
    Joined
    Aug 2007
    Posts
    294
    Location
    Are you saying that as you add a new row, it gets coloured and you don't want it to? - yes....

    100%

  4. #4
    VBAX Tutor
    Joined
    Aug 2007
    Posts
    294
    Location
    ok, i have managed to work out the answer i think here is me vba code

    Sub No_Fill_backgroundColour()
    With Application
    .ScreenUpdating = False
    End With
    Dim rng As Range, cell As Range

    Set rng = Range("B4:B" & Cells(65536, "B").End(xlUp).Row)

    For Each cell In rng
    If (cell.Offset(0, -1).Value <> "") Then
    cell.Interior.ColorIndex = xlNone
    End If
    Next cell

    With Application
    .ScreenUpdating = True
    End With
    End Sub

Posting Permissions

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