+ Reply to Thread
Results 1 to 3 of 3

Converting a range of times via a Macro

  1. #1
    Registered User
    Join Date
    05-18-2008
    Posts
    54

    Converting a range of times via a Macro

    Hi Guys

    Have a slight problem. Each week I receive a worsheet with a range of times along with a lot of other data. However the times in the sheet are all in local time. What I need is for the time to be in GMT.

    I have been able to do this one line at a time, but what I need to do is when the sheet opens for all the times to convert automatically, via a macro or VBA or even by embedding a button in the sheet.

    I have attached a sheet with some times and the formula I am currently using to convet the time by line.

    Any help would be much appreciated.

    Thanks

    Matt
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Converting a range of times via a Macro

    Give this a try, you'll have to adjust the range so that it points to the cells with all your times in it:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Converting a range of times via a Macro

    Hello peakymatt,

    You should update your profile to include where you are located on this big planet and which version or versions of Excel you are using. It would be a big help to everyone trying to answer your question, especially in this case.

    This can be a bit complex to calculate correctly. Here are a few links that provide more detail about what is involved.

    Time Zones And Daylight Savings Time

    Convert Local Date/Time to GMT (Supports Daylight Saving Time/Summer Time)
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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