+ Reply to Thread
Results 1 to 3 of 3

divide value and copy at the end of the list

  1. #1
    Registered User
    Join Date
    11-12-2009
    Location
    Lucca, Italy
    MS-Off Ver
    Excel 2003
    Posts
    53

    divide value and copy at the end of the list

    Hi
    I am completely new to VBA.
    I have a in sheet1 in A and B column employees ID and in C a sale.
    In A I have always an ID, in B i can have zero or an ID, in C a sale
    A_______B______C
    81021___0_______500
    81032___81044___2000
    81048 __0_______1450

    For each row
    If the value in B = 0 i don't have to do anything
    I b <> 0 i have to divide the value of C by 2, write 0 in B and append at the end of the list in A the ID that i have in B and enter the value/2 in C
    From the above example the result will be:

    A B C
    81021__0 ___500
    81032__0 __1000
    81048__0 __1450
    81044__0 __1000

    Thanks
    Last edited by fabdav; 12-18-2011 at 10:14 AM.

  2. #2
    Valued Forum Contributor Sadath31's Avatar
    Join Date
    03-02-2011
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Office 365
    Posts
    452

    Re: divide value and copy at the end of the list

    here is the code


    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-12-2009
    Location
    Lucca, Italy
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: divide value and copy at the end of the list

    Thanks a lot

+ 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