Protect Datasheet with regard to cell fomat/border - excel

Hello Excle'rs and Vba'ers,
I'd like to know if it's possible to set certain limitations protecting the excel datasheet with an password. My protected excel sheet has a certain "unprotected" range of cells, where the user can fill in data.
Unfortunately I want to limitate the user to only fill in data, BUT NOT change the background color or border size of those cells. Is this possible? Maybe with some VBA code?
Thank you!

If I understand you correctly, then there is a way.
Step 1) Select the cells you want the user to be able to fill data into and then format those cells such that they have an UNCHECKED "Locked" property.
Step 2) Right click the worksheet's tab and select "Protect Sheet..."
Step 3) Make sure "Select unlocked cells" is checked and "Format cells" is UNCHECKED. Here's how that might look:
Now your worksheet should be locked, yet users can still enter data into the cells you "unlocked" in step 1. But they cannot change the fill or border situation of any cells in the worksheet, because they cannot format any cells in the worksheet.

Related

Deleting a pivot table in Excel; no gridlines remaining

I've deleted a pivot table in code by first selecting it, and then pressing delete. The area that the pivot table occupied is now not displaying gridlines. All other cells in this sheet are displaying gridlines. I have googled this problem, and several suggestions have been mooted in response to similar questions. These include:
Navigate to Page Layout tab, and click on View Gridlines.
Navigate to File / Options / Advanced, and ensure Gridline Colour is set to Automatic.
Select the affected cells, and click Ctrl+1 to format the cells. Go to the Border tab and ensure that none of the borders are active.
Select the affected cells, navigate to Home tab on the ribbon, and set the Colour Fill option to No Fill.
Ensure that there is no conditional formatting on the spreadsheet.
None of the above work. However, if I copy and paste a cell from an unaffected area of the spreadsheet to the affected area, the gridlines then become visible. This is not an ideal solution though.
Can anyone help?
I can't seem to attach a version of the spreadsheet to this post.
A cell does (simplified) contain a content and a format. By using ENTF key you clear content. If you want to delete both there is two ways:
By VBA:
You need to clear Formats on the range as follows:
Range("your Range").ClearFormats
The format remains because you have used clearContents by just deleting
Use Range("Your Range").Clear to delete both content and format
Without VBA:
See the picture below and select ClearALL in the Menu
Select the area where your PivotTable used to be, and then go to "Home" > "Editing" > "Clear" ([Alt],[H],[E],[A])
You have deleted the contents of cells, but not the cells themselves, not the special PivotTable formatting.

Hide formulas in excel without protecting the sheet

I need to hid the formulas in my sheet without protecting the sheet,say i have sheet 1 in that i need to hide the formulas from range(A1:G10) i can hide the formula but iam not able to provide input for the whole sheet
My requirement is to hide the selected cells formulas and able to give inputs for other cells in the same sheet how can i achieve this.
Select the whole sheet, right click and then select Format Cells.... In the popup window, select Protection tab. Unselect both options and press OK button. This will unlock all cells on the sheet as by default all cells are locked. Next, select your range, repeat the above process again but this time ensure that both options (Locked and Hidden) are selected this time and press OK. Now protect your sheet (in Excel 2013, select the REVIEW tab and select Protect Sheet option and follow the steps).
This will hide your formulas and stop anyone changing the values in the protected cells

Lock range not whole sheet from being edited using vba

I have an excel sheet with 100s of rows. I want to be able to lock a particular range from being edited while the others can be left editable. And protect the locked range with a password.
Please help
Activesheet.protect locks the whole sheet. I want it only for a few cells.
F1 opens the Excel help. If you do a search in there, or on google, the top result would be the following link:
https://support.office.com/en-us/article/Lock-or-unlock-specific-areas-of-a-protected-worksheet-75481b72-db8a-4267-8c43-042a5f2cd93a
This should help you out.
In short:
Right click on the cells you want editable
Format Cells...
Tab Protection
For cells that people should be able to Edit: Uncheck "Locked". For cells that people should NOT be able to edit, leave the check for "Locked".
Click OK.
Next, go to the Review tab in the Ribbon and protect your sheet as normal.

Allow Copy/Paste and change font in an unlocked cell of a locked Excel sheet

I am creating a template in excel where I only want the user to be able to enter information in some of the cells. For that reason I have locked some cells and unlocked some others and I have also protect the corresponding sheet.
The user wants to be able to copy information from other excel sheet to one of the unlocked cells of the template and be able to change the format of the pasted text, being bold and underline options avaliable.
Is there any way to do that without having to unlock the sheet?
Thank you in advance for your time.
There are options when you apply protection to the sheet to still allow formatting.
There is no issue copying and pasting into a locked cell as far as I am aware.
There is an option when you apply protection to a worksheet in Excel to allow "Format Cells". Choose this if you want them to be able to apply formatting to the cell. Likewise, Format Rows and Format Columns if you want the user to be able top adjust the row height and column width.

Is it possible to add a logo or other picture in an Excel sheet and lock its position on the sheet?

I am looking for a way to add a logo or other picture in an Excel sheet and lock its position on the sheet, so that the user won't get annoyed if he happen to grab it while using.
I tried locking cells, sheet, but nothing seems to work.
I am using Excel 2007.
Not really a programming question but the way to do this is...
Right click the image and choose Size and Properties.
Click Properties tab and under properties,(optional- choose Don't move or size with cells) and ensure the Locked box is checked.
Highlight the cells of the worksheet you want the users to be able to edit, right click inside one of them and choose Format Cells. In the protection tab uncheck the locked checkbox.
Then you can protect the worksheet. Click Home, then Format, then Protect Sheet.
Make sure you unselect Select locked cells, leave the top checkbox selected (Protect worksheet and contents of locked cells) as well as select unlocked cells checked.

Resources