Hide tab sheet in webpage (Excel)

G

Guest

Hi,
I've hidden my sheet tabs via the tools - options - view, but when published
in web view or saved as web page they appear, how can I hide?

Thank you.
 
T

topola

Try the following procedures to manipulate with sheets Hidden/ Visible
properties.

Sub Hide_My_Worksheet()
Application.Worksheets("Sheet1").Visible = xlSheetHidden
End Sub

Sub UnHide_My_Worksheet()
Application.Worksheets("Sheet1").Visible = xlSheetVisible
End Sub

Instead of "Sheet1" you can indicate number of the sheet to be hidden.
 
G

Guest

Hi, thanks for your help.
however, how do I do this? should I update in Excel of in the webpage?
and how do I proceed?

Thanks
 
T

topola

Open Visual Basic Editor from EXCEL:
Tools > Macro > Visual Basic Editor
alternatively
ALT + F11.

In VISUAL BASIC EDITOR:
With the proper VBAProject i.e. your workbook e.g. Book2:
Insert > Module
In Module Copy and Paste the provided code for the two macro procedures
(beging with "Sub ...", ending "End Sub" each).

Back in Excel (you can use Alt + Tab) you should already have two
macros available.
Tool > Macro > Macros (Alt + F8). Here you can RUN them.

When you hide proper sheets (run macro Hide_My_Worksheet) try exporting
the workbook to the web again.

Report us where you are...
 
G

Guest

Hi,
thanks for your assistance, I can now hide the sheet2, however, I have
created an hyperlink to open the sheet2 but in the web page I cannot view
anything at all if it's hidded.

The results is same if I were to hide in excel and publish in web page.
is there anyway I could still hide the sheet2 in webpage but and to open
when I click on the hyperlink?
e.g.
sheet1 = hyperlink to open sheet2
sheet2 = (hidden in web page) but once click on sheet1, it's blank nothing
appear.

Appreciate your assistance.
 
T

topola

Hi,
I don't have experience with exporting Excel to web. I expect however
that it should behave in a similiar way. Forgive me if I am wrong.

I would try using macro procedures instead of hyperlinks.
I assume we are hiding/unhiding sheet1.

This would select cell C3 in sheet1:
Sub MyCell1()
Hide_My_Worksheet
Cells(3,3).Select
End Sub

This would go to the range called MyRange:
Sub MyRange1()
Hide_My_Worksheet
Application.Goto Reference:="MyRange"
End Sub

To hide sheet1 when you leave it:
Right click on Sheet1 tab. Select ViewCode. In this module copy/paste
this command:

Private Sub Worksheet_Deactivate()
Hide_My_Worksheet
End Sub

Check how it works for you and let me know,
Regards,
Tomek
 
H

Hansn

Hi there, I have the same problem now. Did you ever get the answer if so can
you let me know.
thank you
 

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