Can VBA Code detect time zone?

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Hi,
I have been thinking that there could be a way to find out what time zone is the user in....
I came across the post in cpearson's site....but couldn't make it work..
I want cell 1 to show show what time zone is the user in. EST or other time zone etc.
Any suggestion and ideas would be great.
Thanks in advance.
 
GetTimeZoneInformation and GetSystemTime have been together so long, I didn't like to split them up!
 
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Old thread, but do you guys mind if I ask for some more clarification--re automatically writing the user's time zone to a cell? I'm still a newB, and have hit a brick wall.

I haven't been able to write the time zone to a cell as Pedie succeeded in doing.

My actions thus far:

With Pearson's code I was able to use:

"=DaylightTime()"
"=LocalOffsetFromGMT(NOW())"

I entered the code you posted into a fresh module, and ran macros. I also called it and ran it as part of a loop I have for other macros. No dice.

Other info:

I still have Pearson's downloaded BAS module running separately as well.
I attempted to alter the (0 to 31) to (32), with no changes.
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top