VBA Valadation xlBetween ERROR

R

Richmont

I am trying to create a valadation list with a range of values fro
another worksheet, however keep getting an error
"Run time ERROR '1004
Application -defined or ojbect defined error."

Following is my code:

With Range("I8").Validation
.Modify xlValidateList, xlValidAlertStop, xlBetween
"=DataSheet.Range($A$1:$A$15)"
.InCellDropdown = True
End With

Appreciate any help with this

Cheers
Ric
 
T

Tom Ogilvy

DataSheet.Range($A$1:$A$15).Name = vList1
With Range("I8").Validation
Modify xlValidateList, xlValidAlertStop, xlBetween,
"=vList1"
InCellDropdown = True
End With
 
R

Richmont

Tom

Still having problems with this line
VBA gives a compile error - it dosn't recognise the symbol "$".

DataSheet.Range($A$1:$A$15).Name = vList1

Cheers
Richar
 
T

Tom Ogilvy

DataSheet.Range("A1:A15").Name = vList1

No, it is looking for a string and you omitted the quotes. It would still
work with

DataSheet.Range("$A$1:$A$15").Name = vList1

assume DataSheet resolves to a valid worksheet reference.
 

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

Top