Stable formating

shahsavand

Board Regular
Joined
Dec 8, 2014
Messages
74
I have workbook contains a lot of sheet.i wanna make all of the sheets' formating hidden only.(not locked)
Even when I create a new sheets
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi,

I am not quite sure what you mean.

However, you can paste Formats from one Worksheet to another. So you could have a Workshheet set up, possible hidden, that had the right formatting and then you could paste it over any new Worksheets when they are created. Would that solve the problem?

You could add some code to detect the creation of a new WOrksheet and apply the Formats automatically. For instance:
Code:
Private Sub Workbook_NewSheet(ByVal Sh As Object)
    Worksheets("Sheet1").Range("A1:F8").Copy
    Sh.Range("A1").PasteSpecial xlPasteFormats
End Sub
That needs to be placed in the ThisWorkbook module.
The example copies the formats from Sheet1 in cells A1:F8 and pastes them into any new Worksheet.

Regards,
 
Upvote 0
One way to do that would be to re-define the Normal format to the protection style that you want.
 
Upvote 0
Hi,

I am not quite sure what you mean.

However, you can paste Formats from one Worksheet to another. So you could have a Workshheet set up, possible hidden, that had the right formatting and then you could paste it over any new Worksheets when they are created. Would that solve the problem?

You could add some code to detect the creation of a new WOrksheet and apply the Formats automatically. For instance:
Code:
Private Sub Workbook_NewSheet(ByVal Sh As Object)
    Worksheets("Sheet1").Range("A1:F8").Copy
    Sh.Range("A1").PasteSpecial xlPasteFormats
End Sub
That needs to be placed in the ThisWorkbook module.
The example copies the formats from Sheet1 in cells A1:F8 and pastes them into any new Worksheet.

Regards,


Maybe I explained it in a bad way.
I have worksheet protected in order to not show the formulas.when I unprotect it and then reprotect it with a macro code it changes to lock formating style again.
I want it to be in hidden format even when I create a new sheet and lock it with password: "s"

Format cells/protection/Locked
 
Upvote 0
It may be the "formatting" word that is causing the confusion.

Are you saying that when you create a new worksheet you want it to be hidden? If so then try this:
Code:
Private Sub Workbook_NewSheet(ByVal Sh As Object)
    If Sh.Type = xlWorksheet Then Sh.Visible = False
End Sub
 
Upvote 0
It may be the "formatting" word that is causing the confusion.

Are you saying that when you create a new worksheet you want it to be hidden? If so then try this:
Code:
Private Sub Workbook_NewSheet(ByVal Sh As Object)
    If Sh.Type = xlWorksheet Then Sh.Visible = False
End Sub


:) yeah hidden word is confusing.
please go to this direction Format cells/protection/Locked

in protection tab there's two option which you can lock or hide a cell format.
i want the whole sheet be in hidden style.even when i create a new worksheet
 
Upvote 0
We probably need to do this in steps.

Is this right?

When a new worksheet is created:

1. Copy formats from the template sheet. (If so, what is the template sheet name?)
2. Paste the formats to the new sheet.
3. Protect the new sheet.
4. Hide it.
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,332
Members
449,077
Latest member
jmsotelo

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