+ Reply to Thread
Results 1 to 11 of 11

How to copy an offset datavalidation to multiple rows

  1. #1
    Forum Contributor
    Join Date
    04-22-2015
    Location
    Scotland
    MS-Off Ver
    365
    Posts
    171

    How to copy an offset datavalidation to multiple rows

    Hi
    I created a dynamic data validation to provide a fixed options list based on the previous cell input, i.e. I need to change the S$28 in the MATCH and COUNTIF as per the example below to match the cell it relates to when going down the full column. As you can imagine this takes a long time so any options would be much appreciated.

    =OFFSET(B7,MATCH($S$28,$A$8:$A$22,0),0,COUNTIF(A8:A22,$S$28),1)

    I am not knowledgeable in using VBa but will try anything rather than writing this formula in every cell but it does provide the exact option I need.

    Thanks

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,380

    Re: How to copy an offset datavalidation to multiple rows

    Usually, the COUNTIF range is absolute and the criteria cell is (partially) variable. So, in this case, probably:

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: How to copy an offset datavalidation to multiple rows

    Hi, welcome to the forum

    If you mean that you want S28 to become S29...S30 etc, as you copy down, then use $S28
    If you mean that you want S28 to become T28...U28 etc, as you copy down, then use S$28

    If you still have a problem, upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Contributor
    Join Date
    04-22-2015
    Location
    Scotland
    MS-Off Ver
    365
    Posts
    171

    Re: How to copy an offset datavalidation to multiple rows

    Hi Ford
    I have put together a sample of what I am doing with the Offset but cant find a way to upload it. Being new to the forum I am still finding my way around, can you tell me where the upload option is?

    Thanks

  5. #5
    Forum Contributor
    Join Date
    04-22-2015
    Location
    Scotland
    MS-Off Ver
    365
    Posts
    171

    Re: How to copy an offset datavalidation to multiple rows

    Hi Ford
    I have put together a sample of what I am doing with the Offset but cant find a way to upload it. Being new to the forum I am still finding my way around, can you tell me where the upload option is?

    Thanks
    Attached Files Attached Files

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: How to copy an offset datavalidation to multiple rows

    If I understand you properly, try rgis...
    =OFFSET($C$7,MATCH($B4,$B$8:$B$20,0),0,COUNTIF($B$8:$B$20,$B4),1)

  7. #7
    Forum Contributor
    Join Date
    04-22-2015
    Location
    Scotland
    MS-Off Ver
    365
    Posts
    171

    Re: How to copy an offset datavalidation to multiple rows

    Thanks for your help, its giving me a an error "You may not use unions, Intersections, or any constants for Data Validation criteria"

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: How to copy an offset datavalidation to multiple rows

    I changed your DV in D4, then copied that to C25:C30 and it woked fine
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    04-22-2015
    Location
    Scotland
    MS-Off Ver
    365
    Posts
    171

    Re: How to copy an offset datavalidation to multiple rows

    Lost my reply to you FDibbins, that looks like the fix.. Is it due to me loading $C$7 rather than C7? the only one that doesn't work for some reason is the WITH SALES, as the validation cell is blank can you tell me if i'm missing something as this will work for me. really appreciate the input.

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: How to copy an offset datavalidation to multiple rows

    I see the problem.

    Your "With Sales" in B17 and b18 have a trailing space. Remove that and you should be good to go

    And yes, it was because you used C7, instead of $C$7. Without the $ (absolute/lock), C7 will change when you copy it down, meaning it becomes C28 (for instance) when copied down

  11. #11
    Forum Contributor
    Join Date
    04-22-2015
    Location
    Scotland
    MS-Off Ver
    365
    Posts
    171

    Re: How to copy an offset datavalidation to multiple rows

    Love it.. thanks for the learning.

+ 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] VBA - Find multiple cell and copy offset
    By Atik in forum Excel General
    Replies: 3
    Last Post: 12-22-2014, 10:50 AM
  2. [SOLVED] Datavalidation dropdown based on multiple criteria
    By Cboggie in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 11-17-2014, 12:00 AM
  3. Replies: 4
    Last Post: 03-08-2013, 09:49 AM
  4. Replies: 1
    Last Post: 11-16-2011, 09:10 AM
  5. Combination: DataValidation auto appear + show all rows
    By helmekki in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-11-2005, 06:48 PM

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