Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. convert negative value to positive

convert negative value to positive

Scheduled Pinned Locked Moved Visual Basic
tutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    isaii
    wrote on last edited by
    #1

    Hi, I have my source file containing numbers and link to my excel. There is some cell that the value of the number must be in negative value but in my source, it is in positive value. Please show me the code on how to convert negative value to positive value, vise versa when it is transferred to my excel template. More thanks.

    C W 2 Replies Last reply
    0
    • I isaii

      Hi, I have my source file containing numbers and link to my excel. There is some cell that the value of the number must be in negative value but in my source, it is in positive value. Please show me the code on how to convert negative value to positive value, vise versa when it is transferred to my excel template. More thanks.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      x = -x Christian Graus - Microsoft MVP - C++

      1 Reply Last reply
      0
      • I isaii

        Hi, I have my source file containing numbers and link to my excel. There is some cell that the value of the number must be in negative value but in my source, it is in positive value. Please show me the code on how to convert negative value to positive value, vise versa when it is transferred to my excel template. More thanks.

        W Offline
        W Offline
        watagal
        wrote on last edited by
        #3

        Multiply your value by negative one, this will convert a positive to a negative and a negative to a positive. x *= -1 Karen Nooobie to OOP and VB.Net 2005

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups