Having a problem using a variable in

K

Kobayashi

I've bastardized the following from a recorded macro but it won't wor
with the variable name 'davvsheet', but it works fine if I specif
workbooks(".....") etc.?

With OSSheet
.Columns("L:L").Select

DAbook.Names.Add Name:="Lookuplist2", RefersToR1C1:= _
"=davvsheet!c1"

Any help would, as always, be much appreciated.

Regards,

Adria
 
J

JulieD

Hi

by placing "davvsheet" in the quotes you've made it a literal string try
RefersToR1C1:= "=" & davvsheet & "!c1"

Cheers
JulieD
 

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