Posts by CWilliams87

    Re: VBA query


    Hi Pike,


    Thanks for the info, are you able to to explain the below? i've never used intesect before and i think i need to extend the range.


    Quote

    If Not Intersect(Target, Range("C:F")) Is Nothing Then
    Target = UCase(Target)


    The range i need to capture is D:AZ any column either side can be excluded.


    many thanks again for your help.


    Regards,


    Cw

    Hi,


    One of my colleagues is looking into designing a log to capture information on what user has updated sections of another spreadsheet and he's asked me to have a look but i completely forgotten how to use VB (its been so long). From the looks of it both sheets are in the same format and he only wants to document the date and username for when that perticular cell has been modified.


    i came up with the below but it doesn't seem to be working, am i missing anything or is there a better way of working this out?


    Code
    1. Private Sub Worksheet_Change(ByVal Target As Range)
    2. If Target.Column < 4 Or Target.Column > 60 Then Exit Sub
    3. Application.EnableEvents = False
    4. Worksheets("User Edits").Cells(Target.Row, Target.Column).Value = Worksheets("User Edits").Cells(Target.Row, Target.Column).Value & Format(Now, "dd/mm") & " " & Environ("USERNAME") & ", "
    5. Application.EnableEvents = True
    6. End Sub


    many thanks in advance.


    CW