+ Reply to Thread
Results 1 to 2 of 2

Vba: Time Delay to execute - Input from Cell Value

Hybrid View

vidyuthrajesh Vba: Time Delay to execute -... 03-18-2014, 08:55 AM
Kaper Re: Vba: Time Delay to... 03-18-2014, 10:24 AM
  1. #1
    Forum Contributor
    Join Date
    02-22-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    102

    Vba: Time Delay to execute - Input from Cell Value

    Hello,

    i would like to delay or pause the application for duration mentioned by the user in the cell Value. The following code gives error message. How do i get this done? Thanks for the assistance. Note : If i store "0:00:10" in Tvalue directly it is running as expected but i would like that to be picked from Cell reference.

    Sub test()
    tvalue = Range("B1").Value
    Application.Wait (Now + TimeValue(tvalue))
    Range("A1").Value = 10
    'Application.Wait (Now + TimeValue("0:00:01"))
    End Sub

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Vba: Time Delay to execute - Input from Cell Value

    tvalue = Range("B1").text
    Because after VBA help:
    TimeValue Function

    Returns a Variant (Date) containing the time.

    Syntax

    TimeValue(time)

    The required time argument is normally a string expression representing a time from 0:00:00 (12:00:00 A.M.) to 23:59:59 (11:59:59 P.M.), inclusive.
    and with
    00:00:01
    in B1
    [B1].value would be 1.15740740740741E-05
    while [B1].text is "00:00:01" as needed for timevalue
    Best Regards,

    Kaper

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Time delay in a particular cell
    By bhushanvshah in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-09-2014, 09:20 PM
  2. Variable Time Delay Cell References
    By freud1 in forum Excel General
    Replies: 2
    Last Post: 06-18-2009, 05:42 PM
  3. Time delay to change cell reference
    By freud1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2009, 12:04 PM
  4. can i execute a calculation in a cell at a certain time of the day
    By terry in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-09-2006, 11:10 AM
  5. [SOLVED] how do i make a cell date sensitive to execute a formula or input.
    By ebuzz13 in forum Excel General
    Replies: 4
    Last Post: 01-20-2005, 05:40 PM

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