View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default Select a Sheet Issue in VBA on a very hidden sheet - fails

Unhide the sheet! This may give you some ideas of how ot get started:
http://excel.tips.net/Pages/T002548_...orksheets.html

http://www.teachexcel.com/macros/del...worksheets.php
http://stackoverflow.com/questions/8...s-or-workbooks


HTH,
Ryan--

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"john" wrote:

You can't select a hidden sheet and in most case you don't need to do this
anyaway

Try changing this:

Sheets(leftstring).Select " so error occurs here
mycodearray = Range("C1:C5000")


to this

mycodearray = Sheets(leftstring).Range("C1:C5000")
--
jb


"christopher ward" wrote:

Dear Experts

I am trying to select a very hidden sheet via VBA whose name I capture from
a form in the Leftstring Variable as shown below. I find I cannot then select
the sheet to capture a range , not sure how i do this - sorry.

I am using Excel 2003 - if you help many thanks as usual

Chris

For i = 0 To DT2.ListBox2.ListCount - 1
If DT2.ListBox2.Selected(i) Then

fullstring = DT2.ListBox2.Value
position = InStr(fullstring, "=")

leftstring = Left(fullstring, position - 1)

rightstring = Right(fullstring, (Len(fullstring) - position))

End If
Next i


Sheets(leftstring).Select " so error occurs here
mycodearray = Range("C1:C5000")



--
C Ward