View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tim Marsh Tim Marsh is offline
external usenet poster
 
Posts: 49
Default "Highlight" Entire Row while entering data

lightspeed,

i started working on a solution, then remembered i had my own work to do!

anyway, here's a possible solution (richt-click on the sheet1 tab, choose
view code and insert this whole bit of code): -

'=========

Option Explicit
Public newrow

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Dim oldrow
On Error Resume Next
oldrow = newrow
Worksheets("Sheet1").Rows(oldrow).Borders(xlEdgeBo ttom).LineStyle = xlNone
Target.EntireRow.Borders(xlBottom).LineStyle = xlContinuous
newrow = ActiveCell.Row
End Sub

'=========

hth,

tim

"lightspeed" wrote in message
ups.com...
THanks for the nifty bit of code It almost does what I want.
Unfortunately, as I said, the conditional formatting on my spreadsheet
is "used up" meaning just about every cell has the maximum (3) formats
already (cells are colored according to their value). I don't want to
loose this formatting when selecting a cell. I am willing to loose
any borders.


Tom Hutchins wrote:
The following VBA event code will put a continuous bottom border on the
active row only, using conditional formatting. Copy & paste it into the
code
module of the sheet where you want it to happen.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.FormatConditions.Delete
With Target.EntireRow
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Borders(xlBottom).LineStyle = xlContinuous
End With
End Sub

Please note: all conditional formatting on the sheet is removed every
time
a different cell is selected.

Hope this helps,

Hutch

"lightspeed" wrote:

I enter spreadsheet data across extremely long rows. I have frozen
important reference data from column A. The trouble is that when I key
in data on the right side of the screen, it's difficult to distinguish
if i'm on the correct row. The spreadsheet has already used up all the
contitional formatting, so coloring even/odd rows won't help me either.


I would love something that puts a hard underline under the entire row
when any cell of that row is selected, and then removes the line when
the cell is unselected. --like using a ruler to read a hardcopy. I
don't use the hard underline anywhere else in the document, so there is
no need to recall the pre-selected status.

any ideas?