+ Reply to Thread
Results 1 to 5 of 5

Modify macro to be relative

  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.
    Please Login or Register  to view this content.
    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.

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

    Re: Modify macro to be relative

    I think i just found it "use relative references" I'll do a recording using relative references and then look at the code and compare to code above and hopefully I can nut it out myself.

    Edit... I need help.
    Last edited by rileyp; 03-25-2013 at 08:33 AM.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Modify macro to be relative

    Hi,

    This shortened macro is one way

    Please Login or Register  to view this content.
    You could also put it in the Sheet Double Click event so that double clicking a cell would automatically run the macro.
    Last edited by Richard Buttrey; 03-25-2013 at 08:17 AM.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

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

    Re: Modify macro to be relative

    Thanks Richard I really like the idea of double clicking but have no idea how to make it happen and what you posted above does work and how it does amazes me but it changes the data in the second column (eg a temperature or valve position etc) to a timestamp...This isnt supposed to happen.
    Thanks for your help

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

    Re: Modify macro to be relative

    err umm delete please double post
    Last edited by rileyp; 03-25-2013 at 09:10 AM. Reason: double post

+ Reply to Thread

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