Macro !!

M

muddan madhu

Hi,

I have excel sheet having 6 coulmns

Col A - Names
col B - Address
col C - Date
Col D - Login
Col E - Any changes in login
col F - Date of change in login

If the user changes the login time in col E... automatically only that
person's
details will reflect in other sheet.

I need macro to run this.. Is this possible ?
 
D

Don Guillett

Without knowing what the other sheet looks like it's hard to say. But, you
could use a worksheet_change event or perhaps even just a simple VLOOKUP
formula.
 
B

Bob Phillips

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "E:E" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
.offest(0, 1).Value = Now
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.
 
B

Bob Phillips

Typo!

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "E:E" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
.Offset(0, 1).Value = Now
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.
 

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

Top