Excel Validataion listbox

  • Thread starter Thread starter strictlydata
  • Start date Start date
S

strictlydata

Hi Guys



Trying to make it simple



I have a sql table with say 6 entries in

ie

Ben

Bob

Fred
Guy

Tony

Garry



I have created a connection and recordset to the sql using vb 2005



on double click I would like to create an excel validation which consists of
these entries

so the user can only select these choices for lets say for all column A



HAs any one got any ideas on how to achieve this?
 
Hi,

Use data menu, Validation

With Selection.Validation
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=
_
xlBetween, Formula1:="Greg;Bob;etc"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Regards
JY
 
Enter the list anywhere in the same sheet (at IU1). Select the cell where you
want the validated list.
Go to Data, Validation. Under Allow select list which will prompt you to
select the list and now you can select the list of names entered in IU1
 
Thank you both for your replies

The problem is the data changes so I don't want the validation to be static
I would like the data to be read from sql everytime the validation is used.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top