View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Xman Xman is offline
external usenet poster
 
Posts: 13
Default Highlighting Rows with VB.

Hi Susan,

Thank you for your suggestion.....It worked great on a blank spread sheet.
But when I applied it to the one I'm working on, it just didn't work. I'm
very new to this whole VB stuff, but hopefully with folks like you willing to
assist I'll find the correct answer. Thanks again.
--
JARoman


"Susan" wrote:

i would leave your macro alone, with the exception of adding this at
the bottom (after "End With"):

worksheets("Sheet1").range("x:x").ClearFormats

you may need to ammend the sheet name or whatever to make it work in
your macro. but that would be the simplest idea, i believe.
make sure you save a copy of your worksheet before trying it, in case
it doesn't do what you want it to. of course this will also remove
formats that had been there previously, so it may not be what you
want.
hope that helps!
:)
susan



On Jan 21, 10:14 am, Xman wrote:
To anyone,

This is the current formula that I am using to highlight rows with:

-- Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.FormatConditions.Delete
With Target.EntireRow
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
With .FormatConditions(1)
With .Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
With .Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
End With
.FormatConditions(1).Interior.ColorIndex = 8
End With

End Sub

Works well...problem, is it removes any coditions that exsist in oter areas
of the SS.
And when I protect the page, the macro no longer works.

Is there any way to modify this command so that a column is skiped? For
instance;
I want the entire row with the exception of column "x". Can this be done?
Any help would be awesome!!!! Thanks,

JARoman