Data Validation - Is there a way to surpass the 255 characters limit?

Anonymous
2017-01-19T12:21:32+00:00

I had created the below formula, which is used for a drop-down list I am preparing. But when I came to paste it in the data validation box, it turned out that I can't insert more than 255 characters, while mine is 776 characters. Any help?

=IF(C2="Humanities List I",IF(C3="English",ENGL1,IF(C3="Others",_OTH1,IF(C2="Humanities List II",IF(C3="American and Media Studies",AMST2,IF(C3="Arabic and Near Eastern Languages",ARAB2,IF(C3="Architecture",ARCH2,IF(C3="Archeology",AROL2,IF(C3="English",ENGL2,IF(C3="Fine Arts and Art History",FAAH2,IF(C3="History",HIST2,IF(C3="Philosophy",PHIL2,IF(C3="Others",_OTH2,IF(C2="Natural Sciences",IF(C3="Others",OTHNS,IF(C2="Quantitative Thoughts",IF(C3="Others",OTHQT,IF(C2="Social Sciences List I",IF(C3="Others",OTHSS1,IF(C2="Social Sciences List II",IF(C3="Economics",ECON2,IF(C3="Education",EDUC2,IF(C3="Political Studies and Public Administration",PSPA2,IF(C3="Sociology and Media Studies",_SMS2,IF(C3="Others",OTHSS2,INDIRECT(SUBSTITUTE(C3," ","")))))))))))))))))))))))))))

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

45 answers

Sort by: Most helpful
  1. Anonymous
    2017-01-26T21:35:29+00:00

    I think you would do better to start a new thread for this new topic - that will enlarge your potential solution-provider population.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2017-01-26T19:38:06+00:00

    Dear Bernie, I hope I can bother you again with my questions. I was watching some videos on youtube, and I had created a search engine after some tutorials. What I found interesting while watching one of the videos is that one of them had included a “gadget” icon inside the search box just like the below:

    I was wondering if it was possible in any way to do this with some coding? Also, I wanted to ask you if you are experienced if I wanted to create a text inside the search box which would say “Search”, but would disappear once clicked on, mainly just like any search engine found online (i.e. youtube, google, etc.), just like the picture below:

    While I was searching for the corresponding codes, I found the below, and I thought you could find them helpful, if they were to be relevant to my question, if you could spare a minute to solve this “new” issue for me.

    If i can hassle you with this in your free time, while making this search engine more user-friendly and dynamic, I'd very much appreciate it brother. I tried upload the sheet, but it seems like OneDrive is down at the moment, Its the same old "GE Courses Description" in case you want to use it, I beleive i had the search engine available in the last link I had sent you.

    Again and again, thank you very much my friend, and please excuse how annoying i'm becoming.

    Sub SearchBox()

    'PURPOSE: Filter Data on User-Determined Column & Text/Numerical value

    'SOURCE: www.TheSpreadsheetGuru.com

    Dim myButton As OptionButton

    Dim SearchString As String

    Dim ButtonName As String

    Dim sht As Worksheet

    Dim myField As Long

    Dim DataRange As Range

    Dim mySearch As Variant

    'Load Sheet into A Variable

      Set sht = ActiveSheet

    'Unfilter Data (if necessary)

      On Error Resume Next

        sht.ShowAllData

      On Error GoTo 0

    'Filtered Data Range (include column heading cells)

      Set DataRange = sht.Range("A4:E31") 'Cell Range

      'Set DataRange = sht.ListObjects("Table1").Range 'Table

    'Retrieve User's Search Input

      mySearch = sht.Shapes("UserSearch").TextFrame.Characters.Text 'Control Form

      'mySearch = sht.OLEObjects("UserSearch").Object.Text 'ActiveX Control

      'mySearch = sht.Range("A1").Value 'Cell Input

    'Determine if user is searching for number or text

      If IsNumeric(mySearch) = True Then

        SearchString = "=" & mySearch

      Else

        SearchString = "=*" & mySearch & "*"

      End If

    'Loop Through Option Buttons

      For Each myButton In sht.OptionButtons

        If myButton.Value = 1 Then

          ButtonName = myButton.Text

          Exit For

        End If

      Next myButton

    'Determine Filter Field

      On Error GoTo HeadingNotFound

        myField = Application.WorksheetFunction.Match(ButtonName, DataRange.Rows(1), 0)

      On Error GoTo 0

    'Filter Data

      DataRange.AutoFilter _

        Field:=myField, _

        Criteria1:=SearchString, _

        Operator:=xlAnd

    'Clear Search Field

      sht.Shapes("UserSearch").TextFrame.Characters.Text = "" 'Control Form

      'sht.OLEObjects("UserSearch").Object.Text = "" 'ActiveX Control

      'sht.Range("A1").Value = "" 'Cell Input

    Exit Sub

    'ERROR HANDLERS

    HeadingNotFound:

      MsgBox "The column heading [" & ButtonName & "] was not found in cells " & DataRange.Rows(1).Address & ". " & _

        vbNewLine & "Please check for possible typos.", vbCritical, "Header Name Not Found!"

    End Sub

    ADDING A CLEAR BUTTON (IF doable also, which would clear out the contents in the search box):

    Sub ClearFilter()

    'PURPOSE: Clear all filter rules

    'Clear filters on ActiveSheet

      On Error Resume Next

        ActiveSheet.ShowAllData

      On Error GoTo 0

    End Sub

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2017-01-25T22:15:00+00:00

    Yes - anytime Excel VBA makes a change to a worksheet, the undo/redo stack is cleared.  That is one small downside of automating some of these processes.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2017-01-25T21:59:57+00:00

    For an unknown reason, I am not able to undo nor redo anything on the latest excel you had shared with me, which worked perfectly (VBA wise)? Do you have any idea why is that?

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2017-01-25T21:56:05+00:00

    I'm always happy to help out. I hope that your problems never reappear - for your sake, not mine  ;-)

    Was this answer helpful?

    0 comments No comments