S
Slim Slender
In a shared work, I would like a user to be able to double-click on a
cell in a particular column, and if the cell is blank, the user's
username is entered. But if the cell has had something entered in it
by another user, the program will detect that and offset to a cell
below the selected one.
I am getting close to what I want with the following but it is not
working perfectly.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
ActiveWorkbook.Save
If Target.Column = 3 Then
If Selection.Value = "" Then
Selection.Value = Environ("username")
Else
Selection.Offset(1, 0).Select
ActiveCell.Value = Environ("username")
End If
End If
ActiveWorkbook.Save
End Sub
The first workbook save should make other users' entries show up on
the current screen but this has not been preventing overwriting. Also,
it will probably be necessary to skip more than one line with entries
sometimes so I think it needs a loop of some kind. Further, it appears
that cutcopy mode stays on when selection is an empty cell, but turns
off when selection is a cell with something in it. Any help would be
appreciated.
cell in a particular column, and if the cell is blank, the user's
username is entered. But if the cell has had something entered in it
by another user, the program will detect that and offset to a cell
below the selected one.
I am getting close to what I want with the following but it is not
working perfectly.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
ActiveWorkbook.Save
If Target.Column = 3 Then
If Selection.Value = "" Then
Selection.Value = Environ("username")
Else
Selection.Offset(1, 0).Select
ActiveCell.Value = Environ("username")
End If
End If
ActiveWorkbook.Save
End Sub
The first workbook save should make other users' entries show up on
the current screen but this has not been preventing overwriting. Also,
it will probably be necessary to skip more than one line with entries
sometimes so I think it needs a loop of some kind. Further, it appears
that cutcopy mode stays on when selection is an empty cell, but turns
off when selection is a cell with something in it. Any help would be
appreciated.