Results 1 to 9 of 9

Using Time Value As Range

Threaded View

bdb1974 Using Time Value As Range 10-09-2009, 04:32 PM
shg Re: Using Time Value As Range 10-09-2009, 05:27 PM
bdb1974 Re: Using Time Value As Range 10-09-2009, 05:54 PM
shg Re: Using Time Value As Range 10-10-2009, 11:22 AM
bdb1974 Re: Using Time Value As Range 10-12-2009, 10:20 AM
  1. #1
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Austin
    Posts
    660

    Using Time Value As Range

    Is there a way to specify a time range to do a specific task?

    If Time Value is before 10:00:00 or between 13:00:00 and 16:00:00 Then
    Do 'THis.

       If TimeValue.Now() <> TimeValue("10:00:00", "16:00:00") Then
       Workbooks("Inventory_New.xls").Activate
     With ActiveWorkbook
        Sheets("Sheet3").Activate
      Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
        With Range("A1:IR" & WorksheetFunction.Max(9, Lastrow))
        .ClearContents
              End With
              End With

    OR


       If TimeValue.Now() <TimeValue("10:00:00") or _
    TimeValue.Now() >TimeValue("16:00:00") Then
       Workbooks("Inventory_New.xls").Activate
     With ActiveWorkbook
        Sheets("Sheet3").Activate
      Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
        With Range("A1:IR" & WorksheetFunction.Max(9, Lastrow))
        .ClearContents
              End With
              End With
    Last edited by bdb1974; 10-12-2009 at 11:23 AM.

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