+ Reply to Thread
Results 1 to 4 of 4

Any way to shorten this time stamping VBA macro code?

  1. #1
    Registered User
    Join Date
    12-30-2010
    Location
    somewhere, USA
    MS-Off Ver
    Excel 2010
    Posts
    86

    Any way to shorten this time stamping VBA macro code?

    I have a problem with a time stamping code for an Excel worksheet that I've set up. Currently the table has 9 contiguous columns of data. I needed the VBA macro to time stamp in the 10th column whenever I added or edited any data within those columns.

    Unfortunately I was forced to manually copy this particular code over and over again up to nine times to satisfy my requirement because of the way this code is set up. I'm wondering if there's a better way to loop through this particular code without copying and pasting this over and over again using an if statement. Here's the code:

    If Target.Column = 1 Then
    Application.EnableEvents = False
    Cells(Target.Row, 10).Value = Date + Time
    Application.EnableEvents = True
    End If

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Any way to shorten this time stamping VBA macro code?

    Perhaps.
    Please Login or Register  to view this content.
    PS Can you add code tags when posting code?
    If posting code please use code tags, see here.

  3. #3
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Any way to shorten this time stamping VBA macro code?

    Perhaps this in your Active sheet module:-
    Please Login or Register  to view this content.
    Regards Mick

  4. #4
    Registered User
    Join Date
    12-30-2010
    Location
    somewhere, USA
    MS-Off Ver
    Excel 2010
    Posts
    86

    Re: Any way to shorten this time stamping VBA macro code?

    I apologize. I forgot to put that in. My bad. Won't happen again.

+ 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. Macro for time stamping..........
    By isameer in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-03-2014, 05:12 AM
  2. [SOLVED] Macro Shorten Code to Paste between two sheets
    By Jiptastic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-20-2013, 02:55 PM
  3. VBA code to shorten Sorting Macro
    By Potholes in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-04-2011, 07:32 PM
  4. Speeding up a Macro (Shorten Code)
    By t0m46 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-07-2010, 09:24 AM
  5. [SOLVED] time-stamping macro
    By trhhs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2005, 08:05 PM

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