Results 1 to 5 of 5

Modify macro to be relative

Threaded View

  1. #1
    Registered User
    Join Date
    03-17-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Modify macro to be relative

    Hi Everyone.
    I have with some help from the kind people on this forum managed to make a small macro that converts a column of timestamps that is not in a format excel can recognize as date time into a excel date time format. It works a treat and I am very happy with it.
    Sub Timestamp()
        '
        ' Timestamp Macro
        '
        ' Keyboard Shortcut: Ctrl+t
        '
            Range("C1").Select
            ActiveCell.FormulaR1C1 = "=LEFT(RC1,10)+(MID(RC1,12,8))"
            Range("C1").Select
            Selection.Copy
            Range("B1").Select
            Selection.End(xlDown).Offset(0, 1).Select
            Range(Selection, Selection.End(xlUp)).Select
            ActiveSheet.Paste
            Columns("C:C").Select
            Selection.NumberFormat = "d/m/yyyy h:mm"
        End Sub
    http://www.excelforum.com/excel-gene...date-time.html
    The next step for me now will be make the macro able to be used in different columns.
    At the moment I can only use it with column A and the new date time is put in column C.
    The data I import always contains 2 columns and I would like to put more than one lot of data onto a sheet.
    Is it possible if each time with my mouse I highlight the top cell two right of the column where the imported timestamp is eg G3 when imported timestamps start at e3 and then run the macro from there.
    Any tips much appreciated
    cheers rileyp
    Last edited by rileyp; 03-25-2013 at 08:04 AM.

Thread Information

Users Browsing this Thread

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

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