Track changes in shared data sheet

Naus

New Member
Joined
Feb 14, 2022
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Hi everyone!

first of all thank you all for taking time to help me with my minor problem
I am currently intern employee in a big Oil & gas company. They are seeking for a excel document that can track changes when different employee's edits the worksheet. I have already inserted a VBA code that track changes in year, date and time.

Problem:
I want to track changes in specific data row in excel. Here i want to create a text box where the individual employee text his/hers name in and there after writing the person's name into a specific column (See screenshot. marked with yellow marker).

I cant quite solve this problem by myself. can you help me?

VBA code:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

Dim myTableRange As Range
Dim myDateTimeRange As Range
Dim myUpdatedRange As Range

If Target.CountLarge > 1 Then Exit Sub

Set myTableRange = Range("Sheet1!$A$2:$I$50")

If Intersect(Target, myTableRange) Is Nothing Then Exit Sub

Set myDateTimeRange = Range("J" & Target.Row)
Set myUpdatedRange = Range("K" & Target.Row)

Application.EnableEvents = False

If myDateTimeRange.Value = "" Then
    myDateTimeRange.Value = Now
Else
    myUpdatedRange = Now
End If

Application.EnableEvents = True

End Sub

1644830868437.png


in advance thank you

// Naus
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
! Update !

I've come across a VBA code I might can use. I want to get a textbox where the employee need to write hes/hers name on and then the dialogbox paste the names in a different cell in excel. But how do i make that code ?

the VBA code i've found:
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim xRtn As Variant
    If Selection.Count = 1 Then
        If Not Intersect(Target, Range("B:B")) Is Nothing Then
            xRtn = Application.InputBox("Insert your name please", "Dialog box")
            If xRtn <> False Then Target.value = xRtn
        End If
    End If
End Sub
 
Upvote 0
try adding this line before your application.enableevents = true

Excel Formula:
range("L" & target.row) = Application.InputBox("Enter Name")
 
Upvote 0
Solution
try adding this line before your application.enableevents = true

Excel Formula:
range("L" & target.row) = Application.InputBox("Enter Name")
Hi Gordsky

Thank you for your reply! I tried to insert the code and the dialog box appers, when i edit a cell, but then i get a debug error. What am i missing? :)
1644838831393.png
 
Upvote 0
try adding this line before your application.enableevents = true

Excel Formula:
range("L" & target.row) = Application.InputBox("Enter Name")[/CODE
[/QUOTE]
Sorry Gordsky. i guess i was exhausted yesterday. Your solution worked. Thank you so much for the help :)
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,175
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top