+ Reply to Thread
Results 1 to 7 of 7

Macro to Change sign of values in Col C

  1. #1
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,739

    Macro to Change sign of values in Col C

    I have tried to write code to change positive values to negatives and vice versa in Col C36:C50


    However when running the macro, I get a run time error "Type mismatch"

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,232

    Re: Macro to Change sign of values in Col C

    If you want to multiply each cell in a range, you need to loop each of them separately.
    But...
    Assuming A1 is always empty (you don't use it):
    Please Login or Register  to view this content.
    Artik

  3. #3
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Macro to Change sign of values in Col C

    Hi there,

    See if the following version of your code does what you need:

    Please Login or Register  to view this content.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Macro to Change sign of values in Col C


    Or with Excel basics in a single codeline : [Recon!C36:C50] = [IF(ISNUMBER(Recon!C36:C50),-Recon!C36:C50,Recon!C36:C50)]

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,598

    Re: Macro to Change sign of values in Col C

    Try this
    Please Login or Register  to view this content.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  6. #6
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,739

    Re: Macro to Change sign of values in Col C

    Hi Guys


    Thanks for all your input


    the code provided works perfectly

  7. #7
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Macro to Change sign of values in Col C

    Hi again,

    Many thanks for your feedback and also for the Reputation increase - much appreciated!

    You're welcome - glad I was able to help.

    Best regards,

    Greg M

+ 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. [SOLVED] Change the positive sign to negative sign in Pivot Table
    By jackson_hollon in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-02-2020, 05:50 PM
  2. [SOLVED] Formula:add degree sign min sign and sec sign to a cell
    By khanaran in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-13-2020, 04:10 PM
  3. Replies: 2
    Last Post: 10-26-2018, 10:03 AM
  4. Replies: 4
    Last Post: 09-22-2015, 12:48 PM
  5. [SOLVED] Macro to find sign "@" and change format of email address
    By xtasio in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-22-2012, 04:17 AM
  6. Counting Values with a change in Sign
    By andrewc in forum Excel General
    Replies: 2
    Last Post: 06-12-2011, 01:30 PM
  7. [SOLVED] how to change cell sign and values
    By me in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-08-2005, 04:06 PM

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