Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7678843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:44:24+00:00 2026-05-31T17:44:24+00:00

I’m having trouble with some Excel data validation. On one sheet, I have a

  • 0

I’m having trouble with some Excel data validation. On one sheet, I have a list of values that contain the list that populates the validation drop-down, like this:

A1 |1.)   New Item
A2 |2.)  Miscellaneous
A3 |3.)  Change Order
A4 |4.)  Choose the item being broken out:
A5 |          Caulk NP-1
A6 |          Safety signs
A7 |          Warning lines
A8 |          Snow fence
A9 |          Drain Lead 4 lb 30"x30" 
A10 |          Cant Strip
A11 |          Screws 1 5/8" 
A12 |          SS Sheet Metal 24 gauge
A13 |          Sheet Metal Aluminum 040 mill finish 
A14 |          Sheet Metal Aluminum .050 mill finish
A15 |          Termination Bar
A16 |          Lead Boots 2"
A17 |          Lead Boots 3" 
A18 |          Modified Bitumen Smooth APP
A19 |          TREMCO ELS Mastic
A20 |          TREMCO Polyroof SF
A21 |          TREMCO Base sheet fasteners
A22 |          TREMCO BURmastic Composite
A23 |          TREMCO PowerPly Standard
A24 |          TREMCO BURmastic SF
A25 |          TREMCO PowerPly HD Base Sheet
A26 |          TREMCO PowerPly Standard FR
A27 |          TREMCO Burmesh 6"
A28 |          TREMCO Site visits
A29 |          TREMCO Reglet Sealant
A30 |          TREMCO WB Primer
A31 |          TREMCO Ice Coating
A32 |          TREMCO Tremflash tape
A33 |          TREMCO Warranty
A34 |          1/4" x 1 1/2" drive pins
A35 |          SS Roof Nails 1 1/4"
A36 |          Freight
A37 |          Auto Fuel
A38 |          PA Direct Labor Supervisor
A39 |          PA Direct Labor Sheet Metal
A40 |          PA Direct Labor Roof Coating
A41 |          Equipment Crane 45 ton
A42 |          Equipment Crane 70 ton
A43 |          Platform Hoist R&G 400 28'
A44 |          Sqeegies 24" Notched
A45 |          Dumpsters
A46 |          Porta John
A47 |          Permit
A48 |          Subcontractor RK Hydro Vac 
A49 |          Subcontractor Roofing ICG
A50 |          Subcontractor Lightning Protection
A51 |          Misc
A52 |          Subtotal

When I have another sheet reference this list, the validation works properly. However, I have a VBA macro that at some point copies this other sheet into a workbook by itself to be emailed. For this and other reasons, I need the validation drop-down list on this column to not be dependent on the other sheet, so I have the macro loop through all of the cells and create a validation string that looks like this:

  1.)   New Item,2.)  Miscellaneous,3.)  Change Order,4.)  Choose the item being broken
out:, Caulk NP-1 , Safety signs, Warning lines

As you can see, it’s the exact same list, but it’s a text string, with each selection separated by commas. It works almost like I need it to, but there is a problem – The 10 leading spaces are not working like they should in the second scenario. I have them there so that those selections are indented in the drop-down box to make it more intuitive. The 10 leading spaces are in the actual “validation list formula”, but don’t show up when I click the drop-down or make a selection!

Any ideas?

EDIT:
As requested, here’s the actual code:

Range("A1").Value = "1.)   New Item"
Range("A2").Value = "2.)  Miscellaneous"
Range("A3").Value = "3.)  Change Order"
Range("A4").Value = "4.)  Choose the item being broken out:"
Range("A5:A350").Formula = "=""          ""&INDIRECT(""'Buy Out'!B""&MATCH(""Description"",'Buy Out'!$B:$B,0)+ROW()-3)"
Application.Calculate

' build ValidationList string for later use (this will also have to happen when misc section isn't built, so this isn't the best place for it)
Range("A1").Select
ValidationList = ActiveCell.Value
ActiveCell.Offset(1, 0).Select
Do Until ActiveCell.Row = 350
    If ActiveCell.Value = "          Subtotal" Or ActiveCell.Offset(3, 0).Value = "          Subtotals" Then 'end of the loop
        Exit Do
    End If

    If ActiveCell.Value <> "" Then
        ValidationList = ValidationList & "," & vbTab & ActiveCell.Value
    End If
    ActiveCell.Offset(1, 0).Select
    If ActiveCell.Row = 349 Then 'this shouldn't ever happen
        ValidationListMessedUp = True
        'MsgBox ("There appears to be a problem creating the drop-down list for the ""Addon Category/Item to Break Out"".")
    End If
Loop


'back to buy out and populate validation as dynamic formula
Sheets("Buy Out").Select
Cells.Find(What:="Addon Category/Item to Break Out", after:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate '* EH and message? "Is this job on the most recent MBO template? It does not appear to have the words "Release #" anywhere on the Buy Out tab

With Range(ActiveCell.Offset(1, 0), ActiveCell.Offset(TotalRow - ActiveCell.Row - 2, 0)).Validation
    .Delete
    .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:= _
        "=INDIRECT(""reference!$A$1:$A$""&IFERROR(MATCH(""          Subtotal"",reference!$A:$A,0)-1,IFERROR(MATCH(""          Grand Total"",reference!$A:$A,0)-1,MATCH(""          Subtotals"",reference!$A:$A,0)-3)))"
    .IgnoreBlank = True
    .InCellDropdown = True
    .InputTitle = ""
    .ErrorTitle = ""
    .InputMessage = ""
    .ErrorMessage = ""
    .ShowInput = True
    .ShowError = True
End With

So the last section of this code that fills the validation with the indirect formula is the one that is working properly. Later on in the code, I populate the “static” validation list using the string. Here is that other piece:

    With Range(ActiveCell.Offset(MiscStartRow - ActiveCell.Row + 1, 0), ActiveCell.Offset(TotalRow - ActiveCell.Row + 5, 0)).Validation
    .Delete
    .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:=ValidationList
    .IgnoreBlank = False
    .InCellDropdown = True
    .InputTitle = ""
    .ErrorTitle = ""
    .InputMessage = ""
    .ErrorMessage = ""
    .ShowInput = True
    .ShowError = True
End With

Thanks so much for the help. This is getting really frustrating.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T17:44:25+00:00Added an answer on May 31, 2026 at 5:44 pm

    Use a vbTab

    For example

    With Selection.Validation
        .Delete
        .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
        xlBetween, Formula1:="1,2,3," & vbTab & "          4,5"
        .IgnoreBlank = True
        .InCellDropdown = True
        .InputTitle = ""
        .ErrorTitle = ""
        .InputMessage = ""
        .ErrorMessage = ""
        .ShowInput = True
        .ShowError = True
    End With
    

    SNAPSHOT

    enter image description here

    Hope this is what you wanted?

    FOLLOW UP

    Using the above method has a drawback. DVlist cannot be more than 255 Characters.

    ALTERNATIVE

    Copy the list to extreme left column (Column XFD (excel 2007/2010) or Column IV (Excel 2003)) of the worksheet so that it is hidden and then use it in DV

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have some data like this: 1 2 3 4 5 9 2 6
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.