Data validation from list : Numbers being auto formatted to text from a text and number list.

I have a list of text and Numbers for eg:

1,2,3, A, B,C

and I called it into a cell (A1) using Data validation>List.

Problem is that the value called in A1 auto formats to 'text' but I want to keep Numbers as Number and text as text only since I have Vlookup linked to A1,if A1 is Number it Vlookups one table and for text it Vlookups another table)

can any one help me to keep the orignal format of the input from the list.

regards

June 11th, 2015 1:16pm

Be sure to format the cell to General.  If we then apply a list as DV:

Sub InternalString()
    Range("B2").Select
    With Selection.Validation
        .Delete
        .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
        xlBetween, Formula1:="alpha,beta,gamma,delta,1,2,3"
        .IgnoreBlank = True
        .InCellDropdown = True
        .InputTitle = ""
        .ErrorTitle = ""
        .InputMessage = ""
        .ErrorMessage = ""
        .ShowInput = True
        .ShowError = True
    End With
End Sub
Then the numbers will entered as numbers and the words as Text.
Free Windows Admin Tool Kit Click here and download it now
June 13th, 2015 2:24pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics