+ Reply to Thread
Results 1 to 11 of 11

negative numbers

  1. #1
    Registered User
    Join Date
    10-04-2013
    Location
    sheffield, england
    MS-Off Ver
    Excel 2010
    Posts
    38

    negative numbers

    dear all,

    i have a spreadsheet that has >30000 rows. the sheet shows 'sale' and 'amount'. in the attached sheet i would like cell B6 to become a negative number as it is a returned item.

    pl provide a macro where for entry 'IP sale return' the corresponding entry in col B becomes a negative number. pl ensure that in this formula or macro i can change the column and row number, as necessary, to get similar result - this is because there are several types of entry for diff. returned items.

    thanks.
    Attached Files Attached Files

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: negative numbers

    Try this code to see if this works as per your requirement.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sktneer; 06-16-2014 at 03:50 PM.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: negative numbers

    Hi,
    Here you go.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: negative numbers

    Another one

    Please Login or Register  to view this content.

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: negative numbers

    If you run the other guys macros twice it will change the negative back to positive. They need some Abs() function in their code to keep this from happening.

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: negative numbers

    Can easily cater for that

    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: negative numbers

    MarvinP,
    If a cell has a lower case(return,not RETURN), your code will not pick that row
    Last edited by AB33; 06-16-2014 at 04:20 PM.

  8. #8
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: negative numbers

    Quote Originally Posted by MarvinP View Post
    If you run the other guys macros twice it will change the negative back to positive. They need some Abs() function in their code to keep this from happening.
    I think that I have taken care of this point in the code. Have you checked it?

  9. #9
    Registered User
    Join Date
    10-04-2013
    Location
    sheffield, england
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: negative numbers

    thanks.
    in my xls, 'sale' is 'col Q' and amount is 'col AU'. how do i change the macro so that this is accounted for? sorry, my grasp of xls macros is very basic.

  10. #10
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: negative numbers

    Please Login or Register  to view this content.

  11. #11
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: negative numbers

    If I change my code as per your new requirement, it would be like this.......
    Please Login or Register  to view this content.

+ 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] SUMIF positive and negative numbers - take double a negative number?
    By Zordrail in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-16-2014, 08:34 AM
  2. negative numbers w/o negative sign
    By whtbullitt in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-31-2009, 05:07 AM
  3. Replies: 5
    Last Post: 05-12-2009, 04:47 PM
  4. Replies: 1
    Last Post: 11-20-2008, 01:52 AM
  5. Replies: 0
    Last Post: 08-23-2005, 03:59 AM

Tags for this Thread

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