Hide cell contents completely - how?

  • Thread starter Thread starter gianni_sacco
  • Start date Start date
G

gianni_sacco

I have a column containing cells that I do not want the
user to see, under ANY circumstances.

How can I hide the column so that there is absolutely no
way for the user to see what is in them?

Everything I've tried so far has a workaround - for
example, although the column is hidden and locked and the
formula bar is deactivated, you can still GO TO a cell in
the column and copy/paste the contents.

Arg. Anybody? Thanks!
 
You can place all the information you don't want the user to see in a other sheet.
you can hide that sheet with Xlsheetveryhidden in the VBA editor.

Or with a macro

Sub test()
Sheets("Sheet2").Visible = xlVeryHidden
End Sub

Sub test2()
Sheets("Sheet2").Visible = True
End Sub
 
Gianni,

One way might be to move the column to a sheet, and set the Visible
propertyh of that sheet xlSheetVeryhidden. You do that in the VBE with the
Project Explorer and Properties window. You'll also have to lock the
project (in VBE it's Tools - Project properties, Protection), to prevent
someone from changing it back to xlSheetVisible.

A formula that refers to it still works. To keep someone from seeing a
reference to it, for any formula that has a reference to it you'll have to
set the formula cell as Hidden (Format - Cells - Protection), and protect
the worksheet.

There are password crackers for all this stuff. Excel is not considered a
secure app. Swiss cheese. But it keeps the honest people out.
 
There is absolutely no way to prevent a knowledgeable user from
seeing the contents of your cells once they have access to your
workbook.

If your users are not knowlegeable, one way would be to put your
data on another sheet, use the VBE's Immediate window or a macro to
hide the sheet with the .visible property = xlVeryHidden, make sure
the referencing cells are locked and hidden, then protect the sheet
and the VBA project.

However, that won't stop anyone who knows enough to use these
newsgroups and find references to ways to unlock sheets, like

http://www.mcgimpsey.com/removepwords.html

Putting all your data in a VBA array, protecting your VBA Project
and performing calculations using event macros also will stop the
uninitiated, but (a) VBA password crackers are cheap, and (b) even
when protected, VBA Code is readable almost in plain text using a
hex editor.
 
Back
Top