Highlighting Rows with VB.
the only thing i can think to do is to record a macro re-installing
the conditional formats you want in column X. when you record the
macro it will put it in a separate module. then, below the clearing
of all formats in column X, put
Call Macro2 'or change it to whatever the name of
'the macro you recorded is
then it will re-install all the conditional formats. a pain to do,
but at least you'd only have to do it once & then the macro would
automatically do it for you each time.
:)
susan
On Jan 22, 12:07*pm, Xman wrote:
Gord, your formula did allow me to lock the worksheet, but as you stated...it
erased everything as I moved the highlight.The original formula with Susans
helpful addition would be ideal if I could get it to leave the conditional
formats I have in column "x" alone and if I could get it to work when it's
protected it would be perfect.
This has become a real obssesion for me because I know there has to be a way
to do it. *I'm gonna keep trying based on the original formula. *I really
appreciate all of your imput, Gord/Susan.
Thanks
--
JARoman
"Gord Dibben" wrote:
This may get you a little closer but does clear some formatting on just the
selected row.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static OldCell As Range
If Application.CutCopyMode = 0 Then
ActiveSheet.Unprotect Password:="justme"
* * If Not OldCell Is Nothing Then
* * With OldCell.EntireRow
* * * *.Interior.ColorIndex = xlColorIndexNone
* * * *.Borders.LineStyle = xlLineStyleNone
* * End With
* * End If
* * Set OldCell = Target
* * With OldCell.EntireRow
* * * *.Interior.ColorIndex = 6
* * * *.Borders.LineStyle = xlContinuous
* * End With
Else
* * If OldCell Is Nothing Then
* * * * Set OldCell = Target
* * Else
* * Set OldCell = Union(OldCell, Target)
* * End If
End If
Me.Range("X:X").ClearFormats
ActiveSheet.Protect Password:="justme"
End Sub
Gord Dibben *MS Excel MVP
On Wed, 21 Jan 2009 09:59:01 -0800, Xman
wrote:
Hi Susan.....you are right! *I had named the sheet something other than
"sheet...." and therfore did not work. *You are also right in saying that any
conditions or formats will be eliminated from that column, thus the reason
for the original question, but it's getting closer. *Now....if I can just get
those conditions and formats back in there.
Thank you.....- Hide quoted text -
- Show quoted text -
|