+ Reply to Thread
Results 1 to 4 of 4

Calculating the difference between 2 values

  1. #1
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Calculating the difference between 2 values

    I have the following code dumping info from a Search Form to a Database:

    Please Login or Register  to view this content.
    In the part of the code

    Sheets("DATABASE").Range("H" & row_number) = txtSickTotal.Text - txtSickUsed.Text

    I would like it to show the difference of 2 separate values in column H. Right now, it is only showing the txtSickTotal.

    Any assistance would be appreciated.

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Calculating the difference between 2 values

    Try this and see if it works:

    Sheets("DATABASE").Range("H" & row_number) = val(txtSickTotal.Value) - val(txtSickUsed.Value)

    - Moo

  3. #3
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: Calculating the difference between 2 values

    Works perfectly!!!! Thank you!!

  4. #4
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Calculating the difference between 2 values

    Glad to help, and thanks for the feedback. =)

    - Moo

+ 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. Calculating difference based on specific cell values
    By thelegazy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-24-2013, 05:36 PM
  2. Calculating % difference between two % values?
    By zudecke in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-01-2013, 06:33 AM
  3. error calculating negativ difference time values
    By Xavier in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-26-2006, 07:00 PM
  4. calculating the difference between 2 numbers
    By Darran in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  5. [SOLVED] Calculating Absolute Difference Between Two Time Values
    By markxus in forum Tips and Tutorials
    Replies: 3
    Last Post: 08-10-2005, 01:43 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