close

Going Blind... is there a code for hiliting a row when any cell in that line
is selected. Thanks.............

P.S.: If can, example with both of:
- grey hilite same as when select row on left,
- amp; a double wide border.

quot;nastechquot; wrote:

gt; Going Blind... is there a code for hiliting a row when any cell in that line
gt; is selected. Thanks.............

You could try this in the worksheet's SelectionChange event:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

' clear any previous highlighting
Columns(1).EntireRow.Interior.ColorIndex = xlNone

' set shading for selection
Target.Rows.EntireRow.Interior.Color = vbYellow
End Sub(As long as you don't use cell shading for any other purpose...)
nastech wrote:
gt; Going Blind... is there a code for hiliting a row when any cell in that line
gt; is selected. Thanks.............nastech,

I don't know if there's a formula. However, you could put the following
macro in the Sheet you're working with:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static mRow As Long
If mRow lt;gt; 0 Then
Rows(mRow).Interior.ColorIndex = xlNone
End If
mRow = Target.Row
Rows(mRow).Interior.ColorIndex = 56
End Sub

You would get there by hitting the visual basic editor and looking for the
sheet name. Double click on it to get a blank screen and paste the macro in
there. It should work.

quot;nastechquot; wrote:

gt; Going Blind... is there a code for hiliting a row when any cell in that line
gt; is selected. Thanks.............

Art wrote:
gt; nastech,
gt;
gt; I don't know if there's a formula. However, you could put the following
gt; macro in the Sheet you're working with:
gt;
gt; Private Sub Worksheet_SelectionChange(ByVal Target As Range)
gt; Static mRow As Long
gt; If mRow lt;gt; 0 Then
gt; Rows(mRow).Interior.ColorIndex = xlNone
gt; End If
gt; mRow = Target.Row
gt; Rows(mRow).Interior.ColorIndex = 56
gt; End Sub
gt;

What if cells have interior.colorIndex set?

I propose to use xor to change colorindex value.

Rows(mRow).Interior.ColorIndex = Rows(mRow).Interior.ColorIndex xor 8

Kris,

Seems like a better idea. Of course depending on the intial color, you
could wind up with something unpleasant.

Art

quot;Krisquot; wrote:

gt; Art wrote:
gt; gt; nastech,
gt; gt;
gt; gt; I don't know if there's a formula. However, you could put the following
gt; gt; macro in the Sheet you're working with:
gt; gt;
gt; gt; Private Sub Worksheet_SelectionChange(ByVal Target As Range)
gt; gt; Static mRow As Long
gt; gt; If mRow lt;gt; 0 Then
gt; gt; Rows(mRow).Interior.ColorIndex = xlNone
gt; gt; End If
gt; gt; mRow = Target.Row
gt; gt; Rows(mRow).Interior.ColorIndex = 56
gt; gt; End Sub
gt; gt;
gt;
gt; What if cells have interior.colorIndex set?
gt;
gt; I propose to use xor to change colorindex value.
gt;
gt; Rows(mRow).Interior.ColorIndex = Rows(mRow).Interior.ColorIndex xor 8
gt;

Hi, don't know if you're still there, did not have time to look at before,
For a macro to hilite line where cursor currently resides, was wondering if
there was a way to use top amp; bottom (medium / heavy) borders to hilite line.
Otherwise if there is a color for yellow / some other hilite than black.

saw an example with yellow line (but rest of script wiped color from sheet):
Target.Rows.EntireRow.Interior.Color = vbYellow

Else first preference might be to have line slighlty greyed / shadowed as it
is when you select line on left (colors- borders should not be destroyed,
colors remain intact while working on line desireable.. ) thanks

Problem ran into is trying to combine with script using for date, can it be
combined with: (thanks)

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count gt; 1 Then Exit Sub
If Target.Row lt; 91 Then Exit Sub
If Me.Cells(.Row, quot;Aquot;).Value = quot;.quot; Then Exit Sub
If Not Intersect(Me.Range(quot;AV:AWquot;), .Cells) Is Nothing Then
Application.EnableEvents = False
With Me.Cells(.Row, quot;BCquot;)
.NumberFormat = quot;ddquot;
.Value = Now
End With
Application.EnableEvents = True
End If
End With
End SubXXXXXXXXXXXXXXXXXXXXXXX

quot;Krisquot; wrote:

gt; Art wrote:
gt; gt; nastech,
gt; gt;
gt; gt; I don't know if there's a formula. However, you could put the following
gt; gt; macro in the Sheet you're working with:
gt; gt;
gt; gt; Private Sub Worksheet_SelectionChange(ByVal Target As Range)
gt; gt; Static mRow As Long
gt; gt; If mRow lt;gt; 0 Then
gt; gt; Rows(mRow).Interior.ColorIndex = xlNone
gt; gt; End If
gt; gt; mRow = Target.Row
gt; gt; Rows(mRow).Interior.ColorIndex = 56
gt; gt; End Sub
gt; gt;
gt;
gt; What if cells have interior.colorIndex set?
gt;
gt; I propose to use xor to change colorindex value.
gt;
gt; Rows(mRow).Interior.ColorIndex = Rows(mRow).Interior.ColorIndex xor 8
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()