View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default active cell shading

Use this instead. When you enter anything in col 12 (L) you will be taken to
the next row and the desired cells will be hilited. Be sure to correct for
any word wrap

Private Sub Worksheet_Change(ByVal Target As Range)'Don Guillett
Dim MyRng As Range
If Target.Column = 12 Then Application.Goto Range("c" & Target.Row + 1),
Scroll = True
ar = ActiveCell.Row
Set MyRng = Range("c" & ar & ",f" & ar & ",i" & ar & "," & "L" & ar)
Application.EnableEvents = False
On Error GoTo end1
Application.Cells.FormatConditions.Delete
With MyRng
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=ROW()=ROW(INDIRECT(CELL(""address"")))"
With .FormatConditions(1).Font
.Bold = True
.Italic = False
.ColorIndex = 1
End With
.FormatConditions(1).Interior.ColorIndex = 36
End With
end1:
Application.EnableEvents = True
End Sub

--
Don Guillett
SalesAid Software

" wrote in message
...
Thanks Don, the below coding worked. However, I should have been more
specific. I am entering data into the spreadsheet in multiple columns. I
would like the next available cell to be shaded (easy to be spotted) that
the
data needs to be entered.

For example, Columns C, F,I, and L are my columns for entering data. The
last row that data was entered was row 5. I want the cells only (C6, F6,
I6
and L6) to be shaded. Once data has been entered in row 6, now row 7
cells
will be shaded and so on. Row 6 cells will return to previous cell
shading
and no formatting will be affected.

I this was more specific and you can help with this problem.

"Don Guillett" wrote:

right click sheet tabview codecopy/paste thissave
now the active cell will be hightlighted while not disturbing other
formatting

'McCurdy.Here is something inspired by Don Guillett.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim MyRng As Range
Set MyRng = Target '.EntireRow
Application.EnableEvents = False
On Error GoTo end1
Application.Cells.FormatConditions.Delete
'Application.Cells.Font.Size = 10
With MyRng
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=ROW()=ROW(INDIRECT(CELL(""address"")))"
With .FormatConditions(1).Font
.Bold = True
.Italic = False
.ColorIndex = 1
End With
'.Font.Size = 20
.FormatConditions(1).Interior.ColorIndex = 36
End With
end1:
Application.EnableEvents = True
End Sub

--
Don Guillett
SalesAid Software

" wrote in
message ...
I have a worksheet that keeps the active cell shaded as the cell moves
down
the column. This was done awhile back, but I can't remember how it was
done.
The active cell only moves down a column, not across the rows. Once
data
has been entered into the cell and the enter key is hit, the next row's
cell
is now active and shaded. Can anyone help me?

(A2 is active and shaded. Data is entered into A2 and the enter key
hit.
A3 is now active and shaded. A2 now has no shading.)