Lock font size

bassls

Board Regular
Joined
Jun 4, 2003
Messages
63
I want to allow users to change data in a cell(s), but prevent them from changing the font, size, style, or anything else. Would creating a form be best?
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
You can look at this:

http://msdn.microsoft.com/en-us/lib....tools.excel.workbook.beforeprint(VS.80).aspx

It will probably do a better job than I will at explaining.

You will have to go into the VBE and find "ThisWorkbook". Doubleclick on it to open it, then click on the dropdown above the code window that says "(General)" to expose the "Workbook" option. Select "Workbook".

To the right of that you will see another dropdown, probably saying "Open". Scroll through that list to find the "BeforePrint" event. The code

Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
 
End Sub

should appear in the code window. That will be where you put your code to revert everything to 12 point Arial...

I imagine it will look something like:

Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
 
     Range("A1:A10").Font.Size = 12
     Range("A1:A10").Font.Name = arial
     Range("A1:A10").Font.Bold = True
 
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,755
Messages
6,180,770
Members
452,996
Latest member
nelsonsix66

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top