PDA

View Full Version : Solved: macro to edit background colour



Pete
11-28-2008, 01:49 AM
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.

Bob Phillips
11-28-2008, 02:49 AM
Are you saying that as you add a new row, it gets coloured and you don't want it to?

Pete
11-28-2008, 02:51 AM
Are you saying that as you add a new row, it gets coloured and you don't want it to? - yes....

100%

Pete
11-28-2008, 03:53 AM
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