SharanKoirala
New Member
- Joined
- Feb 7, 2012
- Messages
- 18
Hi,
I have got a excel file with different sheets with the detail of different projects. The first sheet has got the list of the projects in one column and the next column is to be stamped with the latest updated date of that project in another sheets using VBA Code. I am trying to make this problem simpler as following.
Sheet 1 - Column A - contains list of projects like Project 1, Project 2, Project3 in different rows etc
Sheet 1 - Column B - I want to stamp the latest update date of the corresponding project.
and the sheet name are in the following way
Sheet 2 - Project 1, Sheet 3 - Project 2, Sheet 4 - Project 3 etc.
Now my problem is if I update the datas in in sheets Project 1, Project 2 or Project 3, I want to stamp the updated date of that project in Sheet 1 next to that project Date.
I tried the following code and saved in "ThisWorkbook" but did not work.
Private Sub Workbook_SheetChange(ByVal Target As Range)
Dim SheetName As String
Dim Found As Range
Dim Lookin As Range
If IsEmpty(Target) Then Exit Sub
SheetName = ActiveSheet.Name
Set Lookin = Worksheets("Sheet1").Range("A1:A25")
Set Found = Lookin.Find(SheetName)
If Found Is Nothing Then Exit Sub
Found.Offset(0, 1).Value = Now
End Sub
If somebody can help me in thsi ASAP I will really appreciate it.
Thanks in advance.
I have got a excel file with different sheets with the detail of different projects. The first sheet has got the list of the projects in one column and the next column is to be stamped with the latest updated date of that project in another sheets using VBA Code. I am trying to make this problem simpler as following.
Sheet 1 - Column A - contains list of projects like Project 1, Project 2, Project3 in different rows etc
Sheet 1 - Column B - I want to stamp the latest update date of the corresponding project.
and the sheet name are in the following way
Sheet 2 - Project 1, Sheet 3 - Project 2, Sheet 4 - Project 3 etc.
Now my problem is if I update the datas in in sheets Project 1, Project 2 or Project 3, I want to stamp the updated date of that project in Sheet 1 next to that project Date.
I tried the following code and saved in "ThisWorkbook" but did not work.
Private Sub Workbook_SheetChange(ByVal Target As Range)
Dim SheetName As String
Dim Found As Range
Dim Lookin As Range
If IsEmpty(Target) Then Exit Sub
SheetName = ActiveSheet.Name
Set Lookin = Worksheets("Sheet1").Range("A1:A25")
Set Found = Lookin.Find(SheetName)
If Found Is Nothing Then Exit Sub
Found.Offset(0, 1).Value = Now
End Sub
If somebody can help me in thsi ASAP I will really appreciate it.
Thanks in advance.