+ Reply to Thread
Results 1 to 3 of 3

Add hours to =Now

Hybrid View

  1. #1
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Add hours to =Now

    Hi there all,

    I am creating a custom function that adds a set amount of hours to =Now depending on the "Priority Target".

    Here it is:

    Function Resolution(Priority_Target As String)
    Select Case Priority_Target
        Case "P1"
            Resolution = Now 
        Case "P2"
            Resolution = Now 
        Case "P3"
        Case "P4"
        Case "S1"
        Case "S2"
        Case "S3"
        Case "S4"
        Case Else
            Resolution = "Unknown Priority Target"
    End Select
        
    End Function
    Basically i can't work out how to add 2 hours, or 4 hours or 20 hours or 100 hours?


    any idea's folks

    thanks for reading my thread
    Last edited by VBA Noob; 09-15-2008 at 08:05 AM.
    Mr MaGoo
    Magoo.Inc MMVII

    If i've helped please add to my Rep by Clicking on the Blue Scales in the top right hand corner of the post

  2. #2
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re:Add hours to =Now

    Lucky this is very easy

    Now()+1 will add 1 day so
    =NOW()+1/24 will add 1 hour
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  3. #3
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Thanks

    THank very much, i knew it would be something like that!!!!!

+ 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. Available hours calculation in Utilization!!!
    By nandhamnk in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-05-2013, 12:41 AM
  2. Counting days and hours
    By roddie in forum Excel General
    Replies: 15
    Last Post: 09-11-2008, 05:15 AM
  3. enhanced hours
    By each in forum Excel General
    Replies: 1
    Last Post: 11-04-2006, 07:18 AM
  4. Counting hours
    By Analyst99 in forum Excel General
    Replies: 3
    Last Post: 10-26-2006, 07:20 PM
  5. Urgent help reqd. in calculating working hours
    By prabodhkgupta in forum Excel General
    Replies: 0
    Last Post: 10-10-2006, 03:11 AM

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