Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[Excel] formatting cells

Status
Not open for further replies.

Zen2

MIS
Dec 25, 2005
1
BE
hi,

i need a routine in excel.
the program knows who is working on it.
if it is me, no problem,
if it is someone else, it goes to a subroutine.
other persons may not change the program,
they may just fill some data in cells.
to see what they have done, the color of their data must be blue.
I tried with a routine, but it don't works.
can you help me to fix this?

thnx,

ps.
below the code that i use

Code:
Sub protect()
   If ActiveSheet.Protection.AllowFormattingCells = False Then
   ActiveSheet.protect AllowFormattingCells:=False
    
    Application.FindFormat.Font.ColorIndex = 2
End If
 
Try using this routine in the worksheet module:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  Target.Font.ColorIndex = 5 '5 is blue on my machine
End Sub
Or use this event to fire your subroutine that checks who is using the workbook, if you pass [tt]Target[/tt] as an argument to your subroutine you can manipulate the [tt]Range[/tt] object there.

Or, look at Tools => Track Changes as the mechanism to, er, eh, Track Changes.

Hope this helps,
CMP


Not sure if this works, I only skimmed the book that came with the software.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top