• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need a Macro to update cell in Sheet 2 based on data in Sheet 1

Maggieh

New Member
Hi
I have a workbook where Sheet 2 is the data source containing all employee information and Sheet 1 displays one individual's information at a time using vlookup to pull in the data.
I want to create a macro button that will write today's date into the 'Date' field in the data source (Sheet2) for the individual currently selected in Sheet 1.

I have attached a simplified workbook on this. Basically I would use the dropdown in Sheet1 to call up an employee then click the button to write the date into the date cell in the data source for that employee.

Very grateful for any suggestions and thanks in advance.
 

Attachments

  • Example Sheets.xlsx
    9.9 KB · Views: 7
Code:
Sub EmpDate()

Dim EmpID As String
Dim EmpRow As String

EmpID = Range("B1")
EmpRow = Worksheets("Data Source").Range("A:A").Find(What:=EmpID, LookIn:=xlValues, LookAt:=xlWhole).Row
Worksheets("Data Source").Range("D" & EmpRow) = Date

End Sub
 
Back
Top