+ Reply to Thread
Results 1 to 6 of 6

If the ID appears once or twice add a 6 to column F

  1. #1
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    If the ID appears once or twice add a 6 to column F

    Hi,

    If the ID appears once or twice in Column A then add a 6 to column H, but if the ID appears 3 or more times in column A then do nothing.

    I would like to use VBA only for excel 2003 because it will be added to a larger VBA later.

    Thanks to Tigeravatar earlier I received the following code which works great for adding a 6 for each ID that appears.

    So if somebody could suggest a way to make only work for the ID appearing either less than 3 times, otherwise the value in column F should be 0.

    Please Login or Register  to view this content.
    End Sub

    David
    Last edited by djfscouse; 03-21-2013 at 10:41 AM.

  2. #2
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Re: If the ID appears once or twice add a 6 to column F

    Could somebody take a look above and see if they can help.

  3. #3
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: If the ID appears once or twice add a 6 to column F

    Hi David
    try it
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Re: If the ID appears once or twice add a 6 to column F

    Hi nilem,

    Thank you for your response, unfortunately it did not work because I put the wrong column down in my initial description of the problem, appologies!

    I have attached my file with the working VBA as a module, but I need it only to add a 6 in column H only if the ID in column A appears once or twice, but if it appears 3 or more times then it should just add a 0 or do nothing.

    Thanks again for any help,

    David
    Attached Files Attached Files

  5. #5
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: If the ID appears once or twice add a 6 to column F

    maybe so
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Re: If the ID appears once or twice add a 6 to column F

    Absolutely perfect! Thanks again nilem.

+ 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