+ Reply to Thread
Results 1 to 5 of 5

[SOLVED] increase value to column based on criteria

  1. #1
    Registered User
    Join Date
    11-19-2011
    Location
    Stockholm
    MS-Off Ver
    Excel 2007
    Posts
    11

    [SOLVED] increase value to column based on criteria

    Hi everyone! Im new to the forum and hope that someone can help me.

    I have a spreadsheet with a lot of stocks that has what I call a "Stop and approve" function.
    For example it could look like this.

    Sheet2
    Input ; Stock ; Output
    1 ; "X" ; 1.0214
    1 ; "Y" ; 0
    2 ; "Z" ; 1.978
    ....

    I would like to create a macro that I have in Sheet1 (my summarize view) to add the value 1 to the input column in Sheet 2 if (Input - Output) < 0.2
    So, the result of the macro to the above would be

    Sheet2
    Input Stock Output
    2 ; "X" ; 1.0214
    1 ; "Y" ; 0
    3 ; "Z" ; 1.978

    Can someone help?
    Last edited by scooby99; 11-20-2011 at 02:56 PM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Stop and approve

    Maybe it will be a lil easier if you attach a sample workbook.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    11-19-2011
    Location
    Stockholm
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Stop and approve

    Hi! I have attached a sample of it. Hope it clarifies.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-19-2011
    Location
    Ireland
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: increase value to column based on criteria

    Hi there, you could try this code, it worked for me on your example:

    Please Login or Register  to view this content.
    Just substitute "A4:A9" to suit your range of inputs.
    Hope this is clear.

    Paul

  5. #5
    Registered User
    Join Date
    11-19-2011
    Location
    Stockholm
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: increase value to column based on criteria

    Hi! It worked perfectly.

    Thank you so much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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