Closed Thread
Results 1 to 8 of 8

Timezone Conversion

  1. #1
    Registered User
    Join Date
    09-21-2010
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    4

    Timezone Conversion

    Hi

    I am totally new to VBA EXCEL and trying to understand it but i got stuck at one problem.
    I am using Excel 2007.

    My problem is regarding conversion of timezones(GMT, EDT, IST etc).
    i have cells B1 to M1 with names of timezones and B2 to M2 with their time differences w.r.t GMT
    GMT is put up in B column
    i know the formula used for conversion if GMT is fixed and all other rows are changed according to its value.
    Formula is: (for C3 value)
    =MOD($B$3-(C2/24)*-1,1)
    But i want the values to change depending upon any value.
    ie if we are changing any cells value , it should adjust all the other cell's values in that row
    and also if user is entering any new cells entry say for IST, other cells should also get filled as per

    i have attached my excel file for rows and columns.

    i have searched a lot but nothing found.
    Any help would be appreaciated.

    Thanks
    Attached Files Attached Files
    Last edited by denroi; 09-22-2010 at 12:05 AM.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Timezone Conversions in VBA Excel

    Hi and welcome to the board,
    as nobody likes to retype data, please add a sheet instead of a picture.

    Thank you

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Timezone Conversions in VBA Excel

    Hi denroi

    Welcome to the forum.

    I agree with Arthur, why post a picture of your workbook? You obviously have one that you could have posted

    Try this demo workbook.
    Select your time zone from the dropdown in A2 then enter your time in B2
    Attached Files Attached Files
    Last edited by Marcol; 09-21-2010 at 06:38 AM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  4. #4
    Registered User
    Join Date
    09-21-2010
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Timezone Conversions in VBA Excel

    thanks marcol
    can u please explain the function u applied i mean y applying B2 in it..?
    i am sorry , may be i am asking silly question. but still i want to understand it
    thanks.

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Timezone Conversions in VBA Excel

    The initial formula is in C3

    Please Login or Register  to view this content.

    $A$3 is the cell that you enter the time you want to convert, this is "anchored" to both row and column.

    MATCH($A2,$C$1:$N$1,0), this returns the position in the range $C$1:$N$1 of the time zone that you choose in B2.

    OFFSET($B$2,0,MATCH($A2,$C$1:$N$1,0)) returns the time difference relative to GMT, by using B2 as a reference we can simply use the value returned by the match formula.

    The rest is just arithmetic to calculate the relative differences between your chosen zone and the others.

    I have added a break down of the formula to the amended workbook attached.

    I have also added this formula to row 5
    Please Login or Register  to view this content.

    It is an easier and non-volatile way to do the same thing, I just hammered down the first thing that came to my head in my first post.

    Hope this helps
    Attached Files Attached Files
    Last edited by Marcol; 09-21-2010 at 07:57 AM.

  6. #6
    Registered User
    Join Date
    09-21-2010
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Timezone Conversions in VBA Excel

    thanks a tonne Marcol.
    I have completed my task.
    i have added a button too which will autogenerate the nxt row having its own drop down cell in column A.
    Thanks!!!

  7. #7
    Registered User
    Join Date
    03-17-2020
    Location
    Riyadh
    MS-Off Ver
    365
    Posts
    7

    Re: Timezone Conversion

    Hi everyone

    if we have the city name in cell A1 how to get GMT result from the web into cell B2 ?

    I mean I want to get the info from the internet immediately .
    is there any function to do it ?

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,805

    Re: Timezone Conversion

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

Closed 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