+ Reply to Thread
Results 1 to 7 of 7

VBA to create Data Validation (including Offset and Match)

  1. #1
    Forum Contributor
    Join Date
    05-18-2004
    Location
    Portland, Oregon
    MS-Off Ver
    2016
    Posts
    182

    VBA to create Data Validation (including Offset and Match)

    Hello All,

    I am trying to have data validation included in my macro which formats and enters formulas in cells.

    The problem seems to be that I have a data validation formula that isn't simply refering to a dynamic range.
    Here is the formula:
    Please Login or Register  to view this content.
    This works great in the list data validation.

    But now I want to put it into my formatting macro which also adds the list data validation.

    I don't know how to make the "B1" dynamic so it always looks in column B but in current row. I tried recording the macro and got this:
    Please Login or Register  to view this content.
    I then tried to change the "B1" to RC2....but it errored out.

    Any ideas or places I should look?

    Thanks,
    Matt

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: VBA to create Data Validation (including Offset and Match)

    Matt

    Have you tried using commas for separators instead of semi-colons?
    If posting code please use code tags, see here.

  3. #3
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: VBA to create Data Validation (including Offset and Match)

    you can concatenate
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  4. #4
    Forum Contributor
    Join Date
    05-18-2004
    Location
    Portland, Oregon
    MS-Off Ver
    2016
    Posts
    182

    Re: VBA to create Data Validation (including Offset and Match)

    Thanks for the suggestions.

    Norie - I use a German excel version, we use ";" instead of ","...I know my status says Portland, but I am currently living in Germany for a while. My bad for not updating my profile, sorry.

    Hi again JosephP - I tried your suggestion and get an application-defined or object-defined error ('1004').

    I would think this is pretty straight forward....puzzling.

    Other ideas?

    Thanks,
    Matt

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: VBA to create Data Validation (including Offset and Match)

    I reckon Norie may be correct-try
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    05-18-2004
    Location
    Portland, Oregon
    MS-Off Ver
    2016
    Posts
    182

    Re: VBA to create Data Validation (including Offset and Match)

    I am open to anything! :-)

    I gave it a try, same error. This is my exact code:
    Please Login or Register  to view this content.
    For simplicity in the thread, I replaced "CustFab_Customer_Group_CLStart" with "NamedRange1" and "CustFab_Customer_Group_CL" with "NamedRange2"....but that shouldn't make a difference if it works in the list data validation directly...right?

    Thanks,
    Matt

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: VBA to create Data Validation (including Offset and Match)

    Matt

    I thought you might be using another version, but VBA generally uses US formatting.

    One thing I notice about the code and formula, there are no worksheet references for either.

    Could you attach a sample workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

+ 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