Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 26th, 2005, 09:54 AM
Authorized User
 
Join Date: Jan 2005
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default PC 's Time


  I am using Excel 2000 to write the Pc's Time on cell , say,
"B12" in Sheet1.
     This is the code I wrote;-

    Range("B12").value = Time

   However, the Pc's time keeps running as each second elapses.
  Is there a code that shows a static current Pc's time?
  This is equivalent to pressing the shortkey Ctl+Shift+; to show the Pc's static current time.
    Appreciate asistance from all gurus!
 
Old April 26th, 2005, 11:20 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

I would try
Code:
    Range("B12").value = Format(Now, "hh:mm:ss")
 
Old April 27th, 2005, 01:37 AM
Authorized User
 
Join Date: Jan 2005
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much, Brian, for your help.

In fact, I have tried that code once on another Pc, but the PC's time still runs.
However, this time when I tried a test run on my present Pc, after having a concurrence of view with you, it works wonderfully!

    I need to check the motherbaord of the other Pc.

     You are a great help!

 CHIN





Similar Threads
Thread Thread Starter Forum Replies Last Post
synchronizing pocket pc time with desktop time bobbyrayudu83 C# 1 April 2nd, 2011 04:28 AM
VC++ 2005 PC ERROR @ PC STARTUP -JUST IN TIME DBUG CPPGUY Visual C++ 2005 0 October 3rd, 2008 12:52 PM
Time Shift time in minus time out lechalas Beginning VB 6 1 August 11th, 2008 01:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.