View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mark Bigelow Mark Bigelow is offline
external usenet poster
 
Posts: 55
Default Need UDF help; cycling through various sheets using VBA name property

Your problem is with this line:

Set userSheet = Choose(i, "Sheet9", "Sheet12", "Sheet15", "Sheet16",
"Sheet17", "Sheet18", "Sheet19")

Change it to:

userSheet = Choose(i, "Sheet9", "Sheet12", "Sheet15", "Sheet16",
"Sheet17", "Sheet18", "Sheet19")

The problem is that you were using the Set keyword, which would be
useful if you wanted to make userSheet an array. In this case, you just
want it to be a single variable.

Let me know if you have questions.

Mark

---
Mark Bigelow
mjbigelow at hotmail dot com
http://hm.imperialoiltx.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!