Data Recording Officer Signing In

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have designed a welcome dialogue box for signing in requiring the data
recording officer to enter his name.

What macro should i assign to the sign in button so as to have the name of
the recording officer appear in Column D for every entry he makes in Column A?
 
First enter this at the top of a standard module:

Public s As String
Sub Button3_Click()
s = Application.InputBox("Enter Name:", 2)
End Sub

Second, create a button with the forms toolbar and assign Button3_Click to it.

Third, open Worksheet code and enter:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A:A")) Is Nothing Then
Exit Sub
End If
n = Target.Row
Cells(n, "D").Value = s
End Sub


When the button is punched, the name will be saved in the public string s.
Whenever an entry in made in column A, that name is entered in Column D in
the same row.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top