Consulting

Results 1 to 6 of 6

Thread: What is the function of minus

  1. #1

    Question What is the function of minus

    This code to sum the values in the column A
    [VBA]
    Cells(1, 2).Formula = "=SUM(A:A)"
    [/VBA]

    Waht is the code or function to minus the values

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Tricky!

    [vba]

    Cells(1, 2).Formula = "=-SUM(A:A)"
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    The result of plus for this values 1,2,4 is 7
    The result of minus for this values 1,2,4 is 1

    but your code show this result -7 its' not as I want 1

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You obviously went to a different school than me.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5

  6. #6
    VBAX Regular
    Joined
    Mar 2005
    Posts
    22
    Location
    Quote Originally Posted by Nader
    The result of plus for this values 1,2,4 is 7
    The result of minus for this values 1,2,4 is 1

    but your code show this result -7 its' not as I want 1
    How is the Sum function supposed to know which values are to be added (4) and which are to be subtracted (1,2)?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •