+ Reply to Thread
Results 1 to 6 of 6

Use a Drop down selection and count how many in column, then offset and add 1

  1. #1
    Registered User
    Join Date
    01-29-2010
    Location
    Scotland
    MS-Off Ver
    Excel 2010
    Posts
    94

    Use a Drop down selection and count how many in column, then offset and add 1

    I am wondering if I can use VBA to have a Drop down selection in Column A to count how many of the selected items are in the column, when selected. Then in column B (same row) offset and add 1 to the count.

    So the user will say select apple from Apple, Orange or Pear, counts how many apples in column A +1 then adds that figure to the cell beside the selection in column B. So th count is 11 apples and the selection will make it 12 so it adds 12 to cell next to apple in column B
    Last edited by v2jtb; 03-21-2012 at 07:31 PM.

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Use a Drop down selection and count how many in column, then offset and add 1

    you can do this with data validation and countif, but i dont fully understand your layout, could you attach a sample with the desired output?
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Registered User
    Join Date
    01-29-2010
    Location
    Scotland
    MS-Off Ver
    Excel 2010
    Posts
    94

    Re: Use a Drop down selection and count how many in column, then offset and add 1

    I hope this helps, also it will be part of another VBA script. I will need to concatinate to make a unique record.
    Attached Files Attached Files

  4. #4
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Use a Drop down selection and count how many in column, then offset and add 1

    you can use this formula to do what you are trying, starting in B11 and down

    =IF(A11<>"",COUNTIF(A$1:A10,A11)+1,"")

  5. #5
    Registered User
    Join Date
    01-29-2010
    Location
    Scotland
    MS-Off Ver
    Excel 2010
    Posts
    94

    Re: Use a Drop down selection and count how many in column, then offset and add 1

    Hi thank you for your help.
    The added bit is that it needs to be concatenated with column A. So the cell in column B will be unique, like Apple1 this will be used as an ID. So the cell keeps the ID, which means that the cell somehow if moved or deleted keeps the ID?
    Attached Files Attached Files
    Last edited by v2jtb; 03-22-2012 at 06:41 PM.

  6. #6
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Use a Drop down selection and count how many in column, then offset and add 1

    after you have the IDs you can paste values over those items. I'm not totaly sure of the application, but that should work.

+ 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