Opeations on xlSheetVeryHidden worksheet

F

Frederick Chow

Hi all,

Can I perform operations, like sorting, on a xlSheetVeryHidden worksheet?
Thanks for your advice.

Frederick Chow
Hong Kong.
 
F

Frederick Chow

Because why I sort on contents on XlSheetVeryHidden sheet, it causes a
run-time error unless I removed it.

Maybe I should try it again.

Frederick Chow
 
D

Dave Peterson

Yes.

Just make sure you fully qualify your ranges and don't do any selecting.

with worksheets("hidden")
.range("a1:g99").sort key1:=.range("a1"), ....
end with
 
T

Tom Ogilvy

Here is an example. Worked for me:

Sub TestSort()
Set sh = ActiveSheet
sh.Visible = xlSheetVeryHidden
Set rng = sh.Range("A1:F30")
rng.Formula = "=trunc(rand()*1000+1)"
rng.Formula = rng.Value
rng.Sort Key1:=sh.Range("B1")
sh.Visible = xlSheetVisible

End Sub
 

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