Excel VBA - Selecting hidden worksheets

H

howie

Hi.

I am designing a workbook in Excel 2002, using VBA6, and i have made
worksheet that contains references and sourcematerial I don't want th
user to see. But when I hid the document, I found that th
sheet(xxx).select function no longer worked.

Help
 
F

Frank Kabel

Hi
in most cases you don't need to select a sheet. Something
like the following works also for hidden sheets:
sub foo()
dim wks as worksheet
set wks = worksheets ("Sheetxxx")
msgbox wks.range("A1").value
end sub
 
D

Don Guillett

You can't select a hidden sheet. But you usually don't need to select a
sheet anyway. Show us your code for suggestions.
sheets("sheet1").select
range("a1").select
activecell.copy
sheets("sheet2").select
range("a1").select
activecell.paste

can be this without selections of any kind
sheets("sheet1").range("a1").copy sheets("sheet2").range("a1")
 
Top