Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Excel Macro.

  • 22-05-2006 09:55AM
    #1
    Registered Users, Registered Users 2 Posts: 624 ✭✭✭


    hi guys,

    can anyone help here.. i think this is a farily easy request. but its been a long time since i wrote any VB code.

    All i want to do is in excel, when the text in A1 is changed the text in E1 will be changed to the time the CELL A1 was modified.

    i will need this to apply to all CELLS e.g. changing A1 will place the time in E1, changing A2 place the time in E2 , A3 -E3 etc...

    thanks for your help!


Comments

  • Registered Users, Registered Users 2 Posts: 684 ✭✭✭Gosh


    Private Sub Worksheet_Change(ByVal Target As Range)
      If Target.Column <> 1 Then Exit Sub
      If IsEmpty(Target(1)) Then Exit Sub
      If Target.Row = 1 Then Exit Sub
      If IsEmpty(Target.Offset(0, 4)) Then
        Target.Offset(0, 4) = Time
      End If
    End Sub
    


  • Registered Users, Registered Users 2 Posts: 624 ✭✭✭lazygit


    thanks so much mate :) perfect!


Advertisement