LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Disable View Code for Sheet?

Hello!

After weeks of Googling and trying unsuccessfully to fuddle through
VBA in order to alter Jim Rech's AutoSize MergeCells macro so that it
would decrease row height instead of just increasing, I ended up
uglifying my spreadsheet. So now it has no merged cells and uses 10-or-
so text boxes per sheet. Plus the user input is in the upper right and
the cells which use that input are diagonally across in the lower left
(alot of unused white space). But now I can use my hackjob autofit
macro that doesn't have to worry about merged cells:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo enditall
Application.EnableEvents = False
Me.Unprotect Password:="bulldog"
Rows("21:22").AutoFit
enditall:
Application.EnableEvents = True
Me.Protect Password:="bulldog"
End Sub

The problem is that even with the workbook protected, you can right-
click on the sheet tab and see the "View Code" menu option and you can
see the VBA and password to unprotect ("bulldog"). How can I hide
that? Can I
put some of the code in the worksheet and the rest (the part that
contains the password) in a general or workbook module? If so, how do
I split the code up to do that?
Thanks!
VR/Lost


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
view raw sheet code SteveDB1 Excel Programming 0 September 3rd 08 10:17 PM
Disable the "view code" option Callan Excel Programming 2 April 10th 06 11:07 AM
is there anyway to make it so the users of my excel spread sheet cant view the macro code w/o a password? Daniel Excel Worksheet Functions 2 June 28th 05 05:34 AM
Disable "Sheet tabs" check box under [Tools][Options]-[View] tab quartz[_2_] Excel Programming 4 April 2nd 05 03:25 AM
How to disable VIEW CODE in the tab of a workbook Marcello do Guzman Excel Programming 6 March 6th 04 07:31 PM


All times are GMT +1. The time now is 01:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"