jayagoglia
New Member
- Joined
- Jul 24, 2014
- Messages
- 3
Simply put I want a macro to auto run upon launching excel 2014, to create Auto Time stamps in cells , when data is WRITTEN or PASTED into adjacent Column cells. I want to do this in multiple "column pairs ". The columns are paired but rows function indepently.
Ex: Column A and B is a Pair: when ever data is written/copied into ANY cell in column B a time stamp gets created in the adjacent cell in Column A. data written B1 - time stamp A1, Data written B2 - timestamp A2.
Column F and G are a pair: when ever data is written/copied into ANY cell in column F a time stamp gets created in the adjacent cell in Column G.
having the ability to pair up columns in any fashion I want will be helpful. Also to have the Time stamp erase automatically when the adjacent cell data gets deleted too.
I have been trying to learn this on my own but was only able to achieve three of the four goals.
1 - auto run macros on opening excel 2013
2 - Autotime stamps
3 - achieving 1 & 2 above on one set of columns (A and B)
**4 - need to include more column pairs
here is the code I used and as far as I got:
Private Sub Workbook_Open()
End Sub
Sub Worksheet_Change(ByVal Target As Range)
Const ColumnsToMonitor As String = "B"
Const DateColumn As String = "A"
Application.EnableEvents = False
If Not Intersect(Target, Columns(ColumnsToMonitor)) Is Nothing Then
Intersect(Target.EntireRow, Columns(DateColumn)).Value = Now
End If
Application.EnableEvents = True
End Sub
Const ColumnsToMonitor As String = "F"
Const DateColumn As String = "G"
Application.EnableEvents = False
If Not Intersect(Target, Columns(ColumnsToMonitor)) Is Nothing Then
Intersect(Target.EntireRow, Columns(DateColumn)).Value = Now
End If
Application.EnableEvents = True
End Sub
The last section in italics was not recognized and I have error messages with ambiguous naming.
I would like a welcome message to appear upon application launch as well if possible.
Please help ...and thank you
Jay Agoglia
Ex: Column A and B is a Pair: when ever data is written/copied into ANY cell in column B a time stamp gets created in the adjacent cell in Column A. data written B1 - time stamp A1, Data written B2 - timestamp A2.
Column F and G are a pair: when ever data is written/copied into ANY cell in column F a time stamp gets created in the adjacent cell in Column G.
having the ability to pair up columns in any fashion I want will be helpful. Also to have the Time stamp erase automatically when the adjacent cell data gets deleted too.
I have been trying to learn this on my own but was only able to achieve three of the four goals.
1 - auto run macros on opening excel 2013
2 - Autotime stamps
3 - achieving 1 & 2 above on one set of columns (A and B)
**4 - need to include more column pairs
here is the code I used and as far as I got:
Private Sub Workbook_Open()
End Sub
Sub Worksheet_Change(ByVal Target As Range)
Const ColumnsToMonitor As String = "B"
Const DateColumn As String = "A"
Application.EnableEvents = False
If Not Intersect(Target, Columns(ColumnsToMonitor)) Is Nothing Then
Intersect(Target.EntireRow, Columns(DateColumn)).Value = Now
End If
Application.EnableEvents = True
End Sub
Const ColumnsToMonitor As String = "F"
Const DateColumn As String = "G"
Application.EnableEvents = False
If Not Intersect(Target, Columns(ColumnsToMonitor)) Is Nothing Then
Intersect(Target.EntireRow, Columns(DateColumn)).Value = Now
End If
Application.EnableEvents = True
End Sub
The last section in italics was not recognized and I have error messages with ambiguous naming.
I would like a welcome message to appear upon application launch as well if possible.
Please help ...and thank you
Jay Agoglia