Having a problem using a variable to add a 'name'

  • Thread starter Thread starter Kobayashi
  • Start date Start date
K

Kobayashi

Julie, thanks, but that hasn't worked I'm afraid?

I think I'm losing the wood for the trees!

Basically, I just want to define a range (column A in sheet 2) in cod
and then use these values for the validation list in sheet 1.
followed a link to the Contextures site, which was very good, as
initially I had the values in different workbooks. This worked but a
soon as I closed the workbook with the validation values in th
workbook with the validation applied lost all the list items. So, I'
opening the validation book, copying the list items from the other boo
to a new sheet, hiding/protecting this sheet and then, and this is wher
I'm stuck, trying to apply validation to a column on one of the sheets
using the value in the, now hidden, sheet?

Hopefully this makes sense?

Regards,

Adria
 
In book1 I had a sheet named davvsheet. It was protected and hidden

In Book2 i ran this code

Sub BBTest()
Dim DAbook as Workbook
Set DAbook = Workbooks("Book1.xls")
DAbook.Names.Add Name:="Lookuplist2", RefersToR1C1:= _
"=davvsheet!c1"
End Sub


It created the name LookupList2 in Book1 adn the name refered to column A of
sheet davvsheet.
 

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