View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] paul.robinson@it-tallaght.ie is offline
external usenet poster
 
Posts: 789
Default change the background's color for current cell

Hi
Put this code in the code module behind the sheet where you want to
colour cells.

Option Explicit
Dim lastCell As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Target.Interior.ColorIndex = 6
On Error Resume Next
lastCell.Interior.ColorIndex = xlColorIndexNone
Set lastCell = Target
End Sub

(To see this code module, open the visual basic editor, identify the
sheet in the explorer pane and double click it)

regards
Paul

On Apr 11, 7:48*am, moshe_xls
wrote:
I'm looking for a macro that marks the current cell in worksheet. It has to
be a dynamic function (for any move the current cell will be mark). I want
that the cell will be colored.
Is there a built-in option for that? If yes how can I defined it? *