+ Reply to Thread
Results 1 to 5 of 5

Macro for updating 2 columns timestamp

  1. #1
    Registered User
    Join Date
    03-14-2016
    Location
    Camarillo, CA
    MS-Off Ver
    ?
    Posts
    3

    Macro for updating 2 columns timestamp

    Hi All,

    using the current macro (found it somewhere, cant remember where) to timestamp one column whenever column "A" is updated:

    Dim WorkRng As Range
    Dim Rng As Range
    Dim xOffsetColumn As Integer
    Set WorkRng = Intersect(Application.ActiveSheet.Range("A:A"), Target)
    xOffsetColumn = 6
    If Not WorkRng Is Nothing Then
    Application.EnableEvents = False
    For Each Rng In WorkRng
    If Not VBA.IsEmpty(Rng.Value) Then
    Rng.Offset(0, xOffsetColumn).Value = Now
    Rng.Offset(0, xOffsetColumn).NumberFormat = "m/dd/yyyy hh:mm am/pm"
    Else
    Rng.Offset(0, xOffsetColumn).ClearContents
    End If
    Next
    Application.EnableEvents = True
    End If
    End Sub

    Is working great but i also want to do the same for column "I", whenever it is updated. Not very familiar with macros so any help is appreciated. Thank you in Advance!

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Macro for updating 2 columns timestamp

    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro for updating 2 columns timestamp

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    03-14-2016
    Location
    Camarillo, CA
    MS-Off Ver
    ?
    Posts
    3

    Re: Macro for updating 2 columns timestamp

    This did not work, when i input data into "A" and "I" it did not update the timestamps.

    Quote Originally Posted by rcm View Post
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-14-2016
    Location
    Camarillo, CA
    MS-Off Ver
    ?
    Posts
    3

    Re: Macro for updating 2 columns timestamp

    This did not work either and sorry if wasnt clear before, but i need a timestamp in column G when A is updated and a timestamp in J when I is updated.

    Quote Originally Posted by AlphaFrog View Post
    Please Login or Register  to view this content.
    **Update**

    Sorry this did work! i just moved my columns around since the order of them didnt mean much and it worked perfect. Thank you!
    Last edited by JorgeP; 03-15-2016 at 12:02 PM. Reason: Solved

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel Macro for updating different columns
    By Garshan300 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2015, 11:22 AM
  2. need macro for auto updating columns
    By jaceyjay in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-21-2014, 06:54 AM
  3. Replies: 1
    Last Post: 05-14-2014, 08:24 AM
  4. When a timestamp doesn't behave as a timestamp
    By mredekopp in forum Excel General
    Replies: 3
    Last Post: 03-07-2011, 03:39 PM
  5. Comparison of several columns in price-updating macro
    By humbertohx in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-13-2009, 04:09 PM
  6. Timestamp macro questions
    By nugundam93 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2007, 04:57 PM
  7. [SOLVED] Timestamp Macro
    By alexfthe in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-12-2006, 07:45 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1