Formatting Cells

D

dyowell

I have designed a worksheet that I want to use for
quotes. I am able to print out the worksheet and it looks
just fine. However, I would like to format the worksheet
so that every cell that is not used in the worksheet can
not even be "clicked". In other words, I would like to
make those unused cells part of the background.

I have not designed this sheet in form view because I am
not familiar with that.

If anyone has any ideas how to do this, please let me
know. Thanks in advance.
 
P

Paul B

dyowell, you could use something like this, unprotect the cells you want to
select
then put this in the thisworkbook code

Private Sub Workbook_Open()
'will not let you select locked cells
'This is a setting that Excel does not remember between closings, so this
'will run each time you open the workbook

'*******change to your sheet name***********
With Worksheets("sheet1")

.Activate
.EnableSelection = xlUnlockedCells
.Protect Contents:=True, UserInterfaceOnly:=True
End With
End Sub

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 97 & 2000
** remove news from my email address to reply by email **
 
D

David Yowell

As I said in my original message, I do not have any experience at VB or
working with forms. Therefore, I am not familiar with codes. When you
say "unprotect all of the cells that I want to select and then put this
in the workbook code", what do you mean. Where is the "workbook code"?
Also, what does the following mean:

'*******change to your sheet name***********
With Worksheets("sheet1")

.Activate
.EnableSelection = xlUnlockedCells
.Protect Contents:=True, UserInterfaceOnly:=True
End With
End Sub

Sorry for the stupid questions, but I'm afraid that I just do not
understand what you are talking about. Thanks for the help.







*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
T

Tom Ogilvy

Unlock the cells you want to allow editing/selection

make the control toolbox toolbar visible and click on the properties button.

Under the enable selection property, select unlocked cells

then go to Tools=>Protect =>Protect sheet.

Do this each time you open the workbook.
 
P

Paul B

David,
To put in this macro, from your workbook right-click the workbook's icon and
pick View Code. This icon is to the left of the "File" menu this will open
the VBA editor, in the left hand window double click on thisworkbook, under
your workbook name, and paste the code in the window that opens on the right
hand side, press Alt and Q to close this window and go back to your
workbook, now this will run every time you open the workbook. If you are
using excel 2000 or newer you may have to change the macro security
settings to get the macro to run.

'*******change to your sheet name***********
With Worksheets("sheet1")

Change sheet1 to the name of the worksheet tab name of the sheet you are
using.

"unprotect all of the cells that I want to select "
Select the cells you want to enter data in, select the first one and hold
down the Ctrl key and click on the others, then format, cells, protection,
and uncheck locked, OK. Save the workbook, close it and then open it again,
you should then only be able to select the cells that you unlocked


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 97 & 2000
** remove news from my email address to reply by email **
 
Top