+ Reply to Thread
Results 1 to 4 of 4

VBA code to Subtract values in Column F with Column E if found non-blank

  1. #1
    Registered User
    Join Date
    01-15-2013
    Location
    Dubai, UAE
    MS-Off Ver
    Excel 2010
    Posts
    57

    VBA code to Subtract values in Column F with Column E if found non-blank

    Please can anyone give me a code that will subtract NOW() values in column F with the NOW() values in column E and populate the answer in column I of the worksheet. I'm doing this to determine the # of working hours of each staff.

    The reason I want a code and not regular formula from excel sheet is that the entries for this worksheet (Admin) will be coming from another worksheet (User). And I want this code to calculate only upon opening of the Admin worksheet.

    Please support. Thanks in advance!

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA code to Subtract values in Column F with Column E if found non-blank

    So you want the code to be in a separate workbook? Do you want the code to open the file containing the Admin worksheet?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    01-15-2013
    Location
    Dubai, UAE
    MS-Off Ver
    Excel 2010
    Posts
    57

    Re: VBA code to Subtract values in Column F with Column E if found non-blank

    Quote Originally Posted by arlu1201 View Post
    So you want the code to be in a separate workbook? Do you want the code to open the file containing the Admin worksheet?
    Hi arlu1201,

    I want the code to be written in the Workbook_Open() of Admin.xlsm in which I will manually open only at the end of each week to see the working hours of staff.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA code to Subtract values in Column F with Column E if found non-blank

    In that case, why dont you input the formulae in the file and save it? When the file is updated, the formulae will get calculated automatically.

+ Reply to Thread

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