LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Add the cell content editors name

Johnny

Error in last post..................

Should read Assumes column A is unlocked and sheet is protected with a password
of "justme"


Gord

On Wed, 07 Mar 2007 11:51:38 -0800, Gord Dibben <gorddibbATshawDOTca wrote:

Johnny

Which username would you like to have entered?

Login name or Application name.

Run this macro to see what you get in the message boxes then post back which one
you want to show. The we'll build you some event code.

Sub which_username()
MsgBox Environ("UserName") 'login name
MsgBox Application.UserName 'application name
End Sub

I'm betting on login name because you are on a network.

I'm also betting you will want to lock the cell after the name has been entered.

Also you will have more than A1 to fill in a name.

Try this event code in the sheet module.

Assumes column A and B are unlocked and sheet is protected with a password of
"justme"

Enters the login name into column B when column A has a date entered.

Then locks the column B cell.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Cells.Column = 2 Then
On Error GoTo enditall
Application.EnableEvents = False
ActiveSheet.Unprotect Password:="justme"
n = Target.Row
If Target.Value < "" _
And Target.Offset(0, 1).Value = "" Then
With Target.Offset(0, 1)
.Value = Environ("username")
.Locked = True
End With
End If
End If
enditall:
Application.EnableEvents = True
ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub


Gord Dibben MS Excel MVP

On Wed, 7 Mar 2007 08:56:22 -0800, Johnny7
wrote:

I'm creating a spreadsheet that different users will use on a network of
computers, with there own "sign ons" as such (its at my place of work).

Different users will be adding dates for when items have been received. for
example cell a1 would be the date they have entered, and cell a2 would have
the name of the person who added the date, once they have entered the date in
a1, id like a2 to automatically enter the authors name.

so...
a1(date manually entered) a2(authors name, added auto once date has been
added)

Is there anyway to do this? I'm using Excel 2000

Many thanks,


John


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Excel 2003 - inserting an editors name into a cell TP GS 180506 Excel Discussion (Misc queries) 3 May 18th 06 03:28 PM
Conditional cell background formatting, based on cell content nosivad Excel Discussion (Misc queries) 5 February 11th 06 11:12 PM
Excel - create button to replace cell content with cell value blackmot Excel Worksheet Functions 3 December 7th 05 05:10 PM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 1 February 11th 05 06:36 AM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 0 February 11th 05 05:35 AM


All times are GMT +1. The time now is 10:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"