ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   referencing hidden sheets (https://www.excelbanter.com/excel-programming/330493-referencing-hidden-sheets.html)

mohsen

referencing hidden sheets
 
Hi, I have three sheets that I do some calculations in. I wrote a form
which provides a single input place for all of the sheets, but I cannot
hide my sheets. Everytime I hide them, so the user only sees the form,
the "sheet (x).select" will cause a compile error because it cannot find
the hidden sheet. Any suggestions, please?



NickHK

referencing hidden sheets
 
mohsen,
If you think about it, that makes sense. If an object is hidden, it cannot
be selected.
Most of Excel's functionality does not require you to select an object.
Obviously you cannot then use Selection, but change these to their Excel
objects.

NickHK

"mohsen" wrote in message
...
Hi, I have three sheets that I do some calculations in. I wrote a form
which provides a single input place for all of the sheets, but I cannot
hide my sheets. Everytime I hide them, so the user only sees the form,
the "sheet (x).select" will cause a compile error because it cannot find
the hidden sheet. Any suggestions, please?





mangesh_yadav[_233_]

referencing hidden sheets
 

In VBA most of the time you do not require to use sheet.select. Without
this you can do almost all the tasks. But if it is inevitable to show a
hidden sheet, then use:

Sheet(x).visible = true
Sheet(x).select

And after your operation is over
Sheet(x).visible = false


Hi, I have three sheets that I do some calculations in. I wrote a form
which provides a single input place for all of the sheets, but I
cannot
hide my sheets. Everytime I hide them, so the user only sees the form,
the "sheet (x).select" will cause a compile error because it cannot
find
the hidden sheet. Any suggestions, please?



Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=375140


Arvi Laanemets

referencing hidden sheets
 
Hi

....
varX=Worksheets("YourHiddenSheet").Range("A1").Val ue
Worksheets("YourHiddenSheet").Range("A1").Value=va rY
etc.


--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )


"mohsen" wrote in message
...
Hi, I have three sheets that I do some calculations in. I wrote a form
which provides a single input place for all of the sheets, but I cannot
hide my sheets. Everytime I hide them, so the user only sees the form,
the "sheet (x).select" will cause a compile error because it cannot find
the hidden sheet. Any suggestions, please?





Nick Hebb

referencing hidden sheets
 
If you turn off ScreenUpdating before the operation, and back on
afterwards, then the user won't see that there's a hidden sheet.
Truthfully though, even with screenupdating on most operations happen
so fast that the user wouldn't detect them anyway.

Application.ScreenUpdating = False
ActiveWorkbook.Sheets("YourHiddenSheet").Visible = True
'
' Your actions here
'
ActiveWorkbook.Sheets("YourHiddenSheet").Visible = False
Application.ScreenUpdating = True



All times are GMT +1. The time now is 03:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com